)
i=n
j=n-1
while j>=1:
i=i*j
j=j-1
print(i)
TypeError: unsupported operand type(s) for -: 'str' and 'int'
You're subtracting a number from string
type of data which is passed over by input function is string(str) in order to do math operation on a numerical data taken by input function you should convert it to integer or float depending on your data
Обсуждают сегодня