83.3k views
0 votes
Intro to coding need help

Prints “How many snakes are there? (Type an integer.)”
Prompts the user for input at the end of the string
Prints “You see n snakes! Run!” (where n is the input value) if the
value is an integer greater than 1 2.0
Prints “You see 1 snake. That's not so bad.” if the value of the input
is 1 2.0
Prints “You don't see any snakes. What a relief!” if the value of the input is 0

User Alex Mann
by
8.9k points

1 Answer

3 votes

Answer: (written in python)

a = int(input("How many snakes are there? (Type an integer.)"))

if a > 1:

print("You see", a ,"snakes! Run!")

elif a == 1:

print("You see 1 snake. That's not so bad.")

else:

print("You don't see any snakes. What a relief!")

User Abel Masila
by
8.0k points