-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
136 lines (118 loc) · 4.21 KB
/
Copy pathmain.py
File metadata and controls
136 lines (118 loc) · 4.21 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
import math
import vin
import robco_terminal
print = robco_terminal.fallout_print
e = math.e
# math.sqrt()1
# math.ceil()
# math.floor()
def nope() -> None:
"""
Aww shit, here we go again...
This function just doesn't do shit.
It doesn't return shit, it doesn't call shit.
It doesn't do math, it doesn't do taxes.
It just is, and that's all it needs to do.
"""
# puff puff
pass
nope()
def radiusfunc():
print()
radius = float(input('Enter the radius of a circle: '))
circumference = 2 * math.pi * radius
print(f"\t\tCircumference is {round(circumference,2)}cm")
def areafunc():
print()
radius = float(input('Enter the radius of a circle: '))
area = math.pi * pow(radius, 2)
print(f"\t\tArea is: {round(area,2)}cm^2")
def hypotenusefunc():
print()
side_a = float(input('Enter side a: '))
side_b = float(input('Enter side b: '))
hypotenuse = math.sqrt((pow(side_a, 2) + pow(side_b, 2)))
print(f"\t\tHypotenuse is {round(hypotenuse,2)}")
def kgstolbsfunc():
print()
print("Converting kilograms to pounds is done by multiplying pounds by 2.205.")
kg = float(input('Enter kgs: '))
lbs = round(kg * 2.205, 2)
print(f"\t\t{lbs} lbs!")
def lbstokgsfunc():
print()
print("Converting pounds to kilograms is done by dividing pounds by 2.205.")
lbs = float(input('Enter pounds: '))
kg = round(lbs / 2.205, 2)
print(f"\t\t{kg} kilograms! ")
def tempconversionfunc():
print()
unit = input("Is the temperature in Celsius or Fahrenheit? (C/F): ")
temp = float(input("What is the temperature?: "))
if unit == "C":
temp = round((9 * temp) / 5 + 32, 1)
print(f"The temperature in Fahrenheit is: {temp}°F")
elif unit == "F":
temp = round((temp-32)*5/9,1)
print(f"The temperature in Celcius is: {temp}°C")
else:
print(f"{unit} is not a valid unit of measurement!")
def madlib():
choice = ""
while choice != "q":
if choice == "quit":
break
print("Give me some silly words!")
adjective1 = input("Enter an adjective (description): ")
noun1 = input("Enter a noun (person, place, thing): ")
adjective2 = input("Enter an adjective (description): ")
verb1 = input("Enter a verb ending with 'ing': ")
adjective3 = input("Enter an adjective (description): ")
print(f'Today I went to a {adjective1.lower()} zoo.')
print(f'In an exhibit, I saw a {noun1.lower()}')
print(f'{noun1.title()} was {adjective2.lower()} and {verb1.lower()}')
print(f'I was {adjective3.lower()}!')
choice = input("Do another one? (y/n): ")
if choice == "y":
continue
if choice == "n" or choice == "q":
print("Thanks for playing! Bye!")
break
else:
print("Uhh ok lets do another one anyway! :)")
if __name__ == '__main__':
robco_terminal.terminal_loading_message()
choice = ""
while choice != "quit":
print()
print("Choose one of the following options:")
print("(1) Find CIRCUMFERENCE of a circle with known radius")
print("(2) Find AREA of a circle with known radius")
print("(3) Find HYPOTENUSE of a triangle with known side a and side b")
print("(4) To convert pounds to kilogram!")
print("(5) To convert kilograms to pounds!")
print("(6) For temperature conversions!")
print("(7) To check a VIN number!")
print("(8) For a silly madlib")
choice = str(input("\tMake choice (q for quit): ")).strip()
if choice == "1":
radiusfunc()
elif choice == "2":
areafunc()
elif choice == "3":
hypotenusefunc()
elif choice == "4":
lbstokgsfunc()
elif choice == "5":
kgstolbsfunc()
elif choice == "6":
tempconversionfunc()
elif choice == "7":
vin.checkvin()
elif choice == "8":
madlib()
elif choice.lower() == "q" or choice == "quit":
robco_terminal.terminal_closing_message()
break
else:
print("Invalid input! Enter the number that corresponds to your choice.")