subject

Nstructions When we read code and predict its output, it is called tracing code.

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
For this challenge, try reading 3 or 4 of your classmates' code as well. Trace their code and predict what it will output, then check the code by running it to see if you got it right, and submit your work for a grade

name = input("What's your name?")

if name == "no" or name == "NO" or name == "name":
print("That's not a name!")
else:
print("Hello " + name)

age = int(input("How old are you?"))

if age < 13:
print("Why are you on the Internet??")
elif age < 18:
print("High school's cool")
else:
print("Wow, a real adult!")

dogs = input("Do you like dogs?")

if dogs == "yes" or dogs == "YES":
fish = input("Do you also like fish?")

if fish == "yes" or fish == "YES":
print("What an animal lover!")
else:
print("Yeah, dogs are great!")
else:
cats = input("What about cats?")

if cats == "no" or cats == "NO":
print("Maybe horses or bunnies?")
else:
print("Cats are cool")

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 22:00
What is the name of the option in most presentation applications with which you can modify slide elements? 1. the option enables you to modify a slide element in most presentation applications.
Answers: 3
question
Computers and Technology, 23.06.2019 18:00
Which finger presses the h key on the keyboard? index finger on the left hand pinky finger on the right hand index finger on the right hand thumb on the left hand
Answers: 1
question
Computers and Technology, 24.06.2019 02:00
What is a loop? a. a collection of function definitions at the top of a program b. a line of code that defines a variable and assigns it a value c. a program that opens the turtle graphics window d. a block of code that repeats a specific number of times
Answers: 1
question
Computers and Technology, 24.06.2019 22:00
True or false technology is often discovered by accident
Answers: 2
You know the right answer?
Nstructions When we read code and predict its output, it is called tracing code.

For thi...
Questions
question
Mathematics, 12.12.2020 16:20
question
Mathematics, 12.12.2020 16:20
question
Business, 12.12.2020 16:20
question
English, 12.12.2020 16:20
question
Mathematics, 12.12.2020 16:20
Questions on the website: 13722363