Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 What % means in this code and what does it do in this case.
Index -> Programming, Python -> Python Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
CheapItalian




PostPosted: Sun Oct 09, 2011 11:30 pm   Post subject: What % means in this code and what does it do in this case.

print("Your Salary is $%0.2f" % amount)

print("The area is $%0.1f" % amount)

print("%7f" % amount)
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Sun Oct 09, 2011 11:45 pm   Post subject: RE:What % means in this code and what does it do in this case.

string format. Look at the documentation for print for details.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
z_cross_fire




PostPosted: Sun Oct 09, 2011 11:47 pm   Post subject: RE:What % means in this code and what does it do in this case.

http://www.informit.com/articles/article.aspx?p=28790&seqNum=2
Display posts from previous:   
   Index -> Programming, Python -> Python Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: