formatting Flashcards
1
Q
str.format()
A
optional method that gives users more control over output
2
Q
use formatting to print a statement reading “Jack loves Dogs”
use the variables below and positional arguments
Name = “Jack”
Animal = “Dogs”
A
Name = “Jack”
Animal = “Dogs”
print(“{0} loves {1}”).format(Name,Animal)
3
Q
use formatting to print a statement reading “Jack loves Dogs”
use the variables below and keyword arguments arguments
Name = “Jack”
Animal = “Dogs”
A
print(“{Name} loves {Animal}”).format(Name=”Jack”,Animal=”Dogs”)
4
Q
Using formatting to display a number to a sf
A
(int) is how many sf