Friday, April 25, 2014

Day 20

Explored some Python at Gork Learning. Worked on, Hour of Code: Disease Epidemic! The curious case of the glowing nose. Learned to write a program that reads in the number of cats in your town, and how many cats are already glowing, and prints out whether all the cats are now glowing or not.

The code I used:
cat = int(input("Estimated total cats? "))
catglow = int(input("How many cats are glowing? "))
if cat > catglow:
print("Not all the cats are glowing.")
print("All the cats are glowing.")

The interaction looked like this:
Estimated total cats? 100
How many cats are glowing? 50
Not all the cats are glowing.

No comments:

Post a Comment