Question: Python Programming 1. Assume that the variable amount refers to 24.325. Write the outputs of the following statements: a. print(Your salary is $%0.2f % amount)
Python Programming
1. Assume that the variable amount refers to 24.325. Write the outputs of the following statements:
a. print("Your salary is $%0.2f" % amount)
b. print("The area is %0.1f" % amount)
c. print("%7f" % amount)
2. Write a code segment that displays the values of the integers x, y, and z on a single line, such that each value is right-justified with a field width of 6.
3. Write a format operation that builds a string for the float variable amount that has exactly two digits of precision and a field width of zero.
4. Write a loop that outputs the numbers in a list named salaries. The outputs should be formatted in a column that is right-justified, with a field width of 12 and a precision of 2.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
