-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpratica14.py
More file actions
25 lines (22 loc) · 759 Bytes
/
pratica14.py
File metadata and controls
25 lines (22 loc) · 759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
print('+','=' * 15,'+')
print('| Exercicio |')
print('+','=' * 15, '+')
nome = input('Qual é seu nome? ')
idade = input('Qual é sua idade? ')
if nome and idade:
print(f'Seu nome é {nome}.')
print(f'Seu nome invertido é {nome[::-1]}')
if ' ' in nome:
print(f'Seu nome tem espaço.')
else:
print('Seu nome não tem espaços.')
if ' ' in nome:
nome = nome.replace(' ', '')
print(f'Seu nome tem {len(nome)} letras.')
else:
print(f'Seu nome tem {len(nome)} letras.')
print(f'A primeira letra do seu nome é {nome[:1]}')
print(f'A ultima letra do seu nome é {nome[-1]}')
print(f'Sua idade é {idade}')
else:
print(f'Desculpe, você deixou campos vazios tente novamente')