Ask 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 field width of 6.

+3
Answers (1)
  1. 30 October, 18:12
    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?
Find 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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers