IN:
people = 20
cats = 30
if people < cats:
print "Many cats! "
if people > cats:
print "Not many cats."
OUT:
Many cats!
Sunday, December 13, 2015
Tuesday, December 8, 2015
6. Asking Questions
IN:
print "How old are you? ",
age = raw_input()
print "You are %r old. " % (age)
OUT:
How old are you? 35
You are 35 old.
print "How old are you? ",
age = raw_input()
print "You are %r old. " % (age)
OUT:
How old are you? 35
You are 35 old.
7. Variables and Names
IN:
cars = 100
drivers = 30
cars_not_driven = cars - drivers
print "There will be ", cars_not_driven, " empty cars today."
OUT:
There will be 70 empty cars today.
cars = 100
drivers = 30
cars_not_driven = cars - drivers
print "There will be ", cars_not_driven, " empty cars today."
OUT:
There will be 70 empty cars today.
Monday, December 7, 2015
Saturday, December 5, 2015
Subscribe to:
Comments (Atom)