1.
largest = None
for i in range(0,6):
d = int(input("Enter a number: "))
if not largest or d > largest:
largest = d
print("Largest: " + str(largest)
2.
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")
Comments
Leave a comment