** * This article is from Udemy "[Introduction to Python3 taught by active Silicon Valley engineers + application + American Silicon Valley style code style](https://www.udemy.com/course/python-beginner/" Introduction to Python3 taught by active Silicon Valley engineers + application + American Silicon Valley style code style ")" It is a class notebook for myself after taking the course of. It is open to the public with permission from the instructor Jun Sakai. ** **
input
while True:
    word = input('Enter:')
    if word == 'ok':
        break
    print('next')
result
# 「Enter:Is displayed, type in the characters, and if "ok", break
Enter:dcajnv
next
Enter:cajnv
next
Enter:vaonfdaa
next
Enter:ok
The entered characters will be str type.
input
while True:
    word = input('Enter:')
    num = int(word)
    if num == 100:
        break
    print('next')
result
# 「Enter:Is displayed, type in a number, and if it is "100", break
Enter:1325
next
Enter:314
next
Enter:100
It is necessary to convert what is received as input to int type.
Recommended Posts