
Patrick B. answered 11/07/20
Math and computer tutor/teacher
iNum=-1
while (int(iNum)>126) or (int(iNum)<32):
iNum = input("Please input the integer between 32 and 126 :>")
flAmt = input("Please input the float :>")
chChar = input("Please input the character :>")
str = input("Please input the string :>")
print(iNum + ' ' + flAmt + ' ' + chChar + ' ' + str)
print(str + ' ' + chChar + ' ' + flAmt + ' ' + iNum)
print(iNum+ ' as character is ' + chr(int(iNum)))
#========================================================================
# Here is another version that uses an ARRAY
#===================================================================
# Online Python compiler (interpreter) to run Python online.
# Write Python 3 code in this online editor and run it.
print("Hello world")
#function that outputs the elements in the list
def PrintList(A):
outbuff = " "
for x in A :
outbuff = outbuff + x + ' '
print(outbuff)
return
iNum = -1
while (int(iNum)<32) or (int(iNum)>126):
iNum = input("Please input the integer between 32 and 126 :>")
flAmt = input("Please input the float :>")
chChar = input("Please input the character :>")
str = input("Please input the string :>")
A = [iNum,flAmt,chChar,str]
PrintList(A)
A.reverse()
PrintList(A)
A.reverse()
PrintList(A)
print(iNum + ' converted to character is ' +chr(int(iNum)))