How do I get the 65 and the A to print on the same line with a space between them like on the expected Output?
Posted: Mon Jun 06, 2022 1:03 pm
How do I get the 65 and the A to print on the same line with a
space between them like on the expected Output?
1 num = int(input("Input a number: ")) 2 3 while num <= 255: if num < 33: print("Error") num= int(input("Input a number: ")) elif num> 126: print("Error") num = int(input("Input a number: ")) else: print (num) print (chr(num)) 12 13 num = int(input("Input a number: ")) Input a number: 65 65 A Input a number: 31 Error Input a number: 127 Error Input a number: 256 Sample input and output: Below is the output when the numbers 65, 31, 127, and 256 are entered consecutively. Input a number: 65 65 A Input a number: 31 Error Input a number: 127 Error Input a number: 256 □N34567890 ==== NM 10 11
space between them like on the expected Output?
1 num = int(input("Input a number: ")) 2 3 while num <= 255: if num < 33: print("Error") num= int(input("Input a number: ")) elif num> 126: print("Error") num = int(input("Input a number: ")) else: print (num) print (chr(num)) 12 13 num = int(input("Input a number: ")) Input a number: 65 65 A Input a number: 31 Error Input a number: 127 Error Input a number: 256 Sample input and output: Below is the output when the numbers 65, 31, 127, and 256 are entered consecutively. Input a number: 65 65 A Input a number: 31 Error Input a number: 127 Error Input a number: 256 □N34567890 ==== NM 10 11