Почему не работает | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Почему не работает

if diap == '0-2': num = input("Введи число: ") rnd = random.randint(0, 2) print(rnd) if num == rnd: print("Верно! Бери скидку 5 руб!") else: print("Не не!")

26th Apr 2020, 10:13 AM
Семен
Семен - avatar
3 Answers
+ 1
You need to convert the string variable num to a numeric value, using int() function.
26th Apr 2020, 12:02 PM
Vitaly Sokol
Vitaly Sokol - avatar
0
Hello, it's python, I dont know how to make this.
26th Apr 2020, 12:12 PM
Семен
Семен - avatar