Just started learning python with Zed Shaw's book. In one of the exercises with def function
want to use raw_input
and don't know how to achieve this. Any help and advice appreciated.
When running code I'm getting this error:
File "drills19.py", line 27, in <module>
boys_and_girls(boys, girls)
File "drills19.py", line 2, in boys_and_girls
print "In your school there are %d boys." % boys_count
TypeError: %d format: a number is required, not str
Regards, Alex
def boys_and_girls(boys_count, girls_count):
print "In your school there are %d boys." % boys_count
print "In your school there are %d girs." % girls_count
print "Total number of students in the school is %d." % (boys_count + girls_count)
print "That's a lot of students!\n"
print "How many boys on the school?"
boys = raw_input(">")
print "How many girls in the school?"
girls = raw_input(">")
boys_and_girls(boys, girls)