


Python, программирование, задачи
Задача в python.
Например, мы можем проверить находится ли оценка между значениями 70 и 100:
grade = 88
if (grade >= 70 and grade <=100):
print("Passed!")
Я изменил на такой код:
grade = input ()
if (grade >= 70 and grade <=100):
print("Passed!")
Чтобы пользователь мог ввести свою цифру и выводился результат.
В итоге получается ошибка
7
Traceback (most recent call last):
File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 31, in
start(fakepyfile,mainpyfile)
File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 30, in start
exec(open(mainpyfile).read(), __main__.__dict__)
File "", line 2, in
TypeError: '>=' not supported between instances of 'str' and 'int'
[Program finished]
str в int переведи, написано же.
то есть: grade=int(input())