Saturday, April 26, 2014

Day 21

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 prints out how many tablets to give to each cat based on how much their nose is glowing.

The code I used:
lum = int(input("Luminosity?"))
if lum < 1:
print("No tablets")
if lum == 1:
print("1 tablet")
if lum > 1:
print("2 tablets")

The interaction looked like this:
No tablets

1 tablet

2 tablets

No comments:

Post a Comment