Hello, 

 

I have this exercise :

 

Try each of the following formatted string operations in a Python shell and 
record the results:

“%s %d %f” % (5, 5, 5)
“%-.2f” % 3
“%-10.2f%-10.2f” % (7, 1.0/2)
print ” $%5.2fn $%5.2fn $%5.2f” % (3, 4.5, 11.2)
 

But if I try in a python 2.7 IDLE enviroment I get this :

 

>>> %s %d %f % (5, 5, 5)
SyntaxError: invalid syntax
>>> print “%s %d %f” % (5, 5, 5)
SyntaxError: invalid syntax

 

Roelof

 
                                          
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to