Basic Python - Print Formatting

Beschreibung

Print Formatting topic using Python 2
Rebecca Noel
Karteikarten von Rebecca Noel, aktualisiert more than 1 year ago
Rebecca Noel
Erstellt von Rebecca Noel vor mehr als 7 Jahre
174
6

Zusammenfassung der Ressource

Frage Antworten
What is %s used for? To format strings into your print statements.
Floating point numbers use the format %n1.n2f where n1 is ____ and n2 is _____. ...the total min. number of digits the string should contain... ...the total numbers to show past the decimal point...
What method does %s use? str()
What method does %r use? repr()
T/F?: When listing several strings to place with a string, order doesn't matter. False. Strings must be written in the order in which they should appear, unless you use the .format() method.
The .format() method is the preferred format method when: - inserting a string - inserting a single value string into multiple places - formatting several objects
T/F?: Python 3 uses the print() function, not the print statement. True
After you import the future Python 3 print module the only way to revert back the Python 2 functionality is to... restart Python or start a new notebook.
Zusammenfassung anzeigen Zusammenfassung ausblenden

ähnlicher Inhalt

Python Quiz
karljmurphy
Think Python
tsilvo2001
What is Python?
Daniel Ingram
Python
54671
Know your Python!
educ8ict
Basic Python - Strings
Rebecca Noel
Study on IoT systems design
Tomasz Cieplak
Python
Kirstie Wu
OpenSource Programming
Faheem Ahmed
Basic Python - Lists
Rebecca Noel