A
A
Artem22813372021-10-14 15:23:07
Python
Artem2281337, 2021-10-14 15:23:07

How to make it so that if a person presses enter, the program would continue to operate?

How to make it so that if a person presses enter, the program would continue to operate?

qwerty = input('Чтобы продолжить нажмите enter')
if qwerty == enter:
    print('Сейчас')

else:
    print('Вы не нажали enter')

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2021-10-14
@Artem2281337

When you press enter, input will simply return an empty string.

qwerty = input('Чтобы продолжить нажмите enter')

if qwerty == '':
    print('Сейчас')
else:
    print('Вы не нажали enter')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question