- #1
2sin54
- 109
- 1
Homework Statement
Hello. I want to write a program which finds the largest number in the sequence typed in by the user. However, when I type in a number it not only gets printed as the input value but gets re-printed as if I have done the print function of that number (though the final answer is correct). How can I solve this issue and make the program cleaner?
2. The attempt at a solution
Code:
seq = [0]
n = int(input("Start typing the sequence (end it with 0)"))
while (n!=0):
n = int(input(n))
seq = seq + [n]
print ("The largest number in the sequence is " + str(max(seq)))