3.7 Code Practice For this lesson, you will come up with your own challenging algorithm for other students to trace. It must contain at least 5 if statements and use at least one AND or OR boolean condition.


Note: Elif or else statements will not count - your statements must be if statements. Each if statement should use a unique variable name.

Respuesta :

var1 = False

var2 = False

var3 = False

var4 = False

var5 = False

if not var1:

   var3 = True

if not var1 and var3:

   var1 = True

   var2 = True

   var3 = False

if not var1 or not var3 and var2:

   var4 = True

if var4 and var1:

   var5 = True

if var5 or not var1:

   var3 = False

I decided to use variables of type boolean. I hope this helps!

Following are the Program to the given question:

Program Explanation:

  • Defining "n" variable that uses input method to an input value from user-end.
  • Defining if block that checks the input value is "no/NO/name" if it's true, it will print the message "It's not a name!", otherwise it will print the input value with the message.
  • In the next step, it defines "a" variable that uses the "int with input" method to input value from the user-end.
  • It also uses a conditional statement that checks the age value and prints the value with the message.
  • At last, the "c, g" variable is defined that using the "input" method to input value and uses a conditional statement that checks the value and prints the value with the message.

Program:

n = input("Enter your name? \n")#defining n variable to input value

if n == "no" or n == "NO" or n == "name":#using if block to check input value

   print("It's not a name!")#print message

else:#else block

   print("Hello " + n)#print value with message

a= int(input("How old are you?\n"))#defining a variable to input value

if a < 13:#using if block to check input value

   print("Why are you on the Internet??")#print message

elif a < 18:#using elif block to check input value

   print("Cool. So, it's your High school.")#print message

else:#else block

   print("Wow, you are adult!")#print message

d = input("Do you like dogs/cat?\n")#defining d variable to input value

if d == "dog" or d == "DOG":#using if block to check input value

   print("Yeah, your dogs lover!")#print message

else:#else block

   print("Yeah, your cat are lover!")#print message

c = input("Do you also like cricket?\n")#defining c variable to input value

if c == "yes" or c == "YES":#using if block to check input value

   print("Wow, your cricket lover!")#print message

else:#else block

   print("your not a cricket lover!")#print message

g = input("Do you also like online game?\n")#defining g variable to input value

if g == "yes" or g == "YES":#using if block to check input value

   print("Yeah, you are game lover!")#print message

else:#else block

   print("Yeah, you aren't game lover!")#print message

Output:

Please find the attached file.

Learn more:

brainly.com/question/19465059

Ver imagen codiepienagoya