repl.it
@acwoss/

HeftyLovingStructure

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import signal
    
def timeout(signum, frame):
    raise Exception('Seu tempo acabou!')
    
signal.signal(signal.SIGALRM, timeout)
signal.alarm(5)

try:
    signal.alarm(5)
    name = input('Qual é o seu nome? ')
    signal.alarm(0)
    print('Seja bem-vindo,', name)
except Exception as e:
    print(e)