Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialYuya Kawahara
825 PointsCannot figure out what I am doing wrong
name = input("What`s your name? ")
if name == "Kenneth": print("{} is a lumberjack and he/she`s OK!", format(name)) else: print("{} sleeps all night and {} works all day!", format(name, name))
2 Answers
Mario Blokland
19,750 PointsHi Yuya Kawahara,
in python you are calling a method by using the dot
operator. Try to replace the comma with a dot and put no whitespace between the string, the dot and the format
method. So it should look something like this:
print "some string in here {}".format(some_variable)
shezazr
8,275 Pointsthere is no comma before format it should be a full stop.
i.e. "{} blah blah".format(name)