Case Study 1:
1. >>> item = 'A dozen eggs'
2. >>> itemPrice = 2.4
3. >>> print("{0} costs ${1:.2f}".format(item, itemPrice) )
4. ???
5. >>> myDict = {'name':'candy bar', 'price':95}
6. >>> print("The {name} costs {price} cents".format(**myDict) )
7. ???
-Refer to the session in the accompanying Case Study 2. What is printed on line 7?
A) The candy bar costs 95 cents
B) The candy bar costs .95 cents
C) The {name} costs {price} cents
D) The 'name:candy bar' costs 'price:95' cents
Correct Answer:
Verified
Q3: How would you use a for loop
Q4: What statement is used to close a
Q5: What string method is used to format
Q6: When using the format method with a
Q7: Case Study 1:
1. >>> item = 'A
Q9: The _ method returns the contents of
Q10: What Python module is used to get
Q11: Use the _ function to connect to
Q12: The data embedded in a file that
Q13: The _ loop continues to perform the
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents