Answer the question
In order to leave comments, you need to log in
How to solve the problem with loops in Python?
Recently I began to study python, I decided to practice and write a program (game) in which the user must guess the number made by the computer!
v = random.randint(0, 9)
print(v)
w = int(input("Your answer"))
for w in v:
if w == v:
print("Congratulations, you won!!!"
) At the beginning of writing the program, I ran into a problem.
line ..., in
for w in v:
TypeError: 'int' object is not iterable
Explain the problem
Answer the question
In order to leave comments, you need to log in
import random
v = random.randint(0, 9)
print(v)
w = int(input("Твой ответ "))
if w == v:
print("Поздравляю ты победил!!!")
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question