Multiple Choice
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 1. What is printed on line 4?
A) A dozen eggs costs $2.4
B) A dozen eggs costs $2.40
C) {0} costs $2.4f
D) The {item} costs {itemPrice} cents
Correct Answer:

Verified
Correct Answer:
Verified
Q23: What string method is used to format
Q24: The data embedded in a file that
Q25: The string format method is used to
Q26: 1. Match each of the descriptions with
Q27: Explain the while loop mechanism and provide
Q28: Once a file has been opened, it
Q29: 1. Match each of the descriptions with
Q30: Explain how the following session, which creates
Q31: Case Study 2:<br>>>> with open("rainfall.txt", "r") as
Q32: It is possible to read online data