7 Matching Annotations
  1. May 2025
    1. # Pasquale Concilio

      Great start, Pasquale! Good use of colab, as well. To make progress from where you are now see if you can write a Python function that takes a number X and prints “Divisible by 5” when the integer is divisible by 5 (but not 35), “Divisible by 7” when the integer is divisible by 7 (but not 35), and “Divisible by 35” when the integer is divisible by both 5 and 7? You have done well to solve the questions in the assignment.

    2. #Creating an if, elif, else block of code # Created 3 variables to use for testing against the block isMorning=False isAfternoon=False isEvening=False if isMorning: print("Good Morning!") # prints if true and then the code ends elif isAfternoon: print("Good Afternoon!") # prints if isAfternoon is true and isMorning is false, then ends. elif isEvening: print("Good Evening!") # prints if isMorning and isAfternoon is false and isEvening is true, then ends else: print("It's late! Go to bed!") # prints if isMorning, isAfternoon, and isEvening is False. Then ends.

      An if, elif, else block is created

    3. #Creating a while loop to print all the vlaues in list_of_five i = 0 # Starting position of list while i < len(list_of_five): #creating the condition to iterate thru the list print(list_of_five[i]) #print command to do with every iteration of the while loop i += 1 #This is to make sure that the loop moves onto the next value and end the loop

      A for loop is used to print each member of the 5-membered list