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:
Luminosity?0
No tablets
Luminosity?1
1 tablet
Luminosity?2
2 tablets
No comments:
Post a Comment