forked from psounis/python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexercise06.py
More file actions
26 lines (21 loc) · 608 Bytes
/
exercise06.py
File metadata and controls
26 lines (21 loc) · 608 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
26
while True:
string = input("Give name: ")
string = string.strip()
if string.isalpha():
name = string.capitalize()
print(f"Name entered: {name}")
break
else:
print("only characters please! ")
while True:
string = input("Give surname: ")
string = string.strip()
if string.isalpha():
surname = string.capitalize()
print(f"Surname entered: {surname}")
break
else:
print("only characters please! ")
print(f"+{28*'-'}+")
print(f"|{(name+ ' ' + surname).center(28)}|")
print(f"+{28*'-'}+")