-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRecap2 ---- Functions.py
More file actions
91 lines (67 loc) · 1.87 KB
/
Copy pathRecap2 ---- Functions.py
File metadata and controls
91 lines (67 loc) · 1.87 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 15 21:00:22 2023
@author: lEO
"""
# FUNCTIONS
# EXAMPLE 1:
# Create a simple human being template using FUNCTIONAL PROGRAMMING
# This human can:
# - SHOP
# - EAT
# - WALK
# - TALK
# - TEACH
def shop():
shopping_stores = {
"Ikeja": [
"Becca Boutique",
"Rico",
"Titi Hair Salon",
"Football Mega House",
"Fanny Fancy Bags"
]
}
location = input("What is your location: ")
shopping_center = input("Where will you like to shop: ")
print("I am going shopping")
def eat():
print("I am eating")
def walk():
print("I am walking")
def talk():
print("I am talking")
def teach():
print("I am teaching")
# ---> Program Starts
print("Welcome to my human emulator")
print("This program is created by: Onyiriuba Leonard\n\n")
you = int(input("Press 1: Become a Man\nPress 2: Become a Woman\nPress 3: Become a Dog\nPress 4: Exit\n\nResponse: "))
if you == 4:
pass
elif you == 3:
action = int(input("As a dog, you can: \n Press 1: Walk\n Press 2: Eat\n\nResponse: "))
if action == 1:
walk()
elif action == 2:
eat()
elif you == 2:
action = int(input("You are now a woman, you can: \n Press 1: Walk\n Press 2: Eat\n Press 3: Talk\n Press 4: Shop\n\nResponse: "))
if action == 1:
walk()
elif action == 2:
eat()
elif action == 3:
talk()
elif action == 4:
shop()
elif you == 1:
action = int(input("You are a man, as a man you can: \n Press 1: Walk\n Press 2: Eat\n Press 3: Talk\n Press 4: Teach\n\nResponse: "))
if action == 1:
walk()
elif action == 2:
eat()
elif action == 3:
talk()
elif action == 4:
teach()