This forum is now read-only. Please use our new forums! Go to forums
Can someone explain the difference between %s, %f and %d.Thanks.
Answer 548eac0376b8fee7a6008423
votes
The internet tells me “%s - Take the next argument and print it as a string%d - Take the next argument and print it as an int” So it’s the same, but affects the data type of the output.
1 comments
about 9 years
Thanks. In the meantime I foung this link if you’re interested: http://stackoverflow.com/questions/15215242/python-2-7-d-s-and-float. Cheers.
Answer 548f5741937676d496009b7d
votes
%s refers to a string data type, %f refers to a float data type, and %d refers to a double data type.
1 comments
about 9 years
Thanks. In the meantime I foung this link if you’re interested: http://stackoverflow.com/questions/15215242/python-2-7-d-s-and-float. Cheers.
Popular free courses
Free Course
Learn SQL
Beginner friendly,
4 Lessons
In this SQL course, you'll learn how to manage large datasets and analyze real data using the standard data management language.
Language Fluency
Free Course
Learn JavaScript
Beginner friendly,
11 Lessons
Learn how to use JavaScript — a powerful and flexible programming language for adding website interactivity.
Language Fluency
Free Course
Learn HTML
Beginner friendly,
6 Lessons
Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.
Language Fluency