Reading input
Read · 1 of 4
input() always gives you text
input() reads one line that was typed in, and gives it to you as a str. To do maths with it, turn it into a number: n = int(input()).
In DSA problems the input is given to your program, and you print only the answer. Don't write input("Enter a number: "): that prompt would be printed and make your output wrong.