Ask Question
23 August, 15:05

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.

+1
Answers (1)
  1. 23 August, 15:39
    0
    x = int (input ("enter first number: "))

    y = int (input ("enter second number: "))

    z = int (input ("enter third number: "))

    print ('%6d %6d %6d' % (x, y, z))

    Explanation:

    Using python programming language we receive three integers variables (x, y, z) then using string formatting (%6) which specifies that the output should be right justified with a width of 6, the values are printed out.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “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 ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers