-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtry.py
More file actions
45 lines (34 loc) · 1018 Bytes
/
try.py
File metadata and controls
45 lines (34 loc) · 1018 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import sys
try:
class robot():
def __init__(self, input_name):
self.input_name = input_name
print("\nYour robot name : " + input_name)
def head(self, part):
self.part = part
print("Head : {}".format(part))
def arm(self, part):
self.part = part
def body(self, part):
self.part = part
def leg(self, part):
self.part = part
class end():
def __init__(self):
print()
def quit(self):
print("[You left the Game]")
sys.exit()
question = input("\nWrite your robot name : ")
Robot = robot(question)
Robot.head("Head Part")
question1 = input("You want to left the game? [ yes | no ]")
if question1 == "yes":
qt = end()
qt.quit()
elif question1 == "no":
pass
except KeyboardInterrupt as err:
print("Wrong answer.")
finally:
print("\nThanks for using this game!")