-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain_temp (Rough).py
More file actions
102 lines (90 loc) · 4.1 KB
/
Copy pathmain_temp (Rough).py
File metadata and controls
102 lines (90 loc) · 4.1 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# This is the start of the main file of the repository. Happy coding :)
choice_dict = {}
#device_type = int()
success_msg = str()
choice_dict = {'1': 'LAPTOP', '2': 'ANDROID', '3': 'IOS'}
student_choice_dict = {
'1': 'Primary/Pre-Primary (Pre-Nursery, Nursery, Kindergarten, Grade 1 & Grade 2)', '2': 'Junior School (Grade 3 to Grade 5)', '3': 'Middle School (Grade 6 to Grade 8)', '4': 'Junior High School (Grade 9 to Grade 10)', '5': 'Senior High School (Grade 11 to Grade 12)'}
profession_choice_dict = {'1':'Student','2':'Software Developer','3':'Business Person','4':'Data Scientist',\
'5': 'Common person (Beginner knowledge of Tech)'}
def end_msg(response):
if response.lower() == 'y':
Select_DeviceType()
elif response.lower() == 'n':
print("Thankyou for using. Exiting now!!")
exit()
else:
print('Press "y" to retry & "n" to exit.\n')
response = input()
end_msg(response)
def Select_DeviceType ():
device_type = int(input("What type of device do you want? \n Choose one from the following: \n 1. LAPTOP \n 2. ANDROID \
\n 3. IOS \n Type numbers for selecting the option. \n"))
#choice = 0
success_msg = "has been selected."
if device_type > 3:
print("Choice not found. Press 'y' to retry & 'n' to exit.\n")
response = input()
end_msg(response)
else:
print("{} {}".format(choice_dict.get(str(device_type)), success_msg))
return "LAPTOP"
def intro_ques():
response = input("What is your profession? \n Choose one from the following: \n 1. Student \n 2. Software Developer \n 3. Business Person \
\n 4. Data Scientist \n 5. Common person (Beginner knowledge of Tech) \n")
#response = int(input())
if response == "1":
print("Student it is.")
student_school_ques()
elif int(response) > 5:
print("Okie Dokie!!")
yes_no = input("Do you want to continue? YES or NO \n").upper()
if yes_no == "YES":
intro_ques()
else:
end_msg('n')
return response
def student_school_ques():
ques_1 = "Are you in school or in college?"
print(ques_1)
validate = input().upper()
if validate == "SCHOOL":
print("Hola school kid!")
print("What kind of school? \n Choose one from the following: \n 1. Primary/Pre-Primary (Pre-Nursery, Nursery, Kindergarten, Grade 1 & Grade 2) \
\n 2. Junior School (Grade 3 to Grade 5)\n 3. Middle School (Grade 6 to Grade 8) \
\n 4. Junior High School (Grade 9 to Grade 10) \n 5. Senior High School (Grade 11 to Grade 12) \
\n Choose a number from the given options.")
choice = int(input())
if choice == 1:
print("{} has been selected.".format(student_choice_dict.get(str(choice))))
elif choice == 2:
print("{} has been selected.".format(student_choice_dict.get(str(choice))))
elif choice == 3:
print("{} has been selected.".format(student_choice_dict.get(str(choice))))
elif choice == 4:
print("{} has been selected.".format(student_choice_dict.get(str(choice))))
elif choice == 5:
print("{} has been selected.".format(student_choice_dict.get(str(choice))))
elif choice > 5:
print("Okie Dokie!!")
yes_no = input("Do you want to continue? YES or NO \n").upper()
if yes_no == "YES":
intro_ques()
else:
end_msg('n')
elif validate == "COLLEGE":
print("Hola college kid!")
else:
yes_no = input("I'm afraid your response is incorrect. Do you want to continue? YES or NO \n").upper()
if yes_no == "YES":
student_school_ques()
elif yes_no == "NO":
intro_ques()
#def student_college_ques():
def main():
device_selected = Select_DeviceType()
if device_selected == "LAPTOP":
profession = intro_ques()
if profession == 1:
student_school_ques()
main()