Skip to content

Commit e7cbd12

Browse files
authored
Add files via upload
1 parent 1217d7b commit e7cbd12

File tree

5 files changed

+32
-0
lines changed

5 files changed

+32
-0
lines changed

Week0/einstein/einstein.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
m = input("m: ")
2+
E = int(m) * (300000000 ** 2)
3+
print(f"E: {E}")

Week0/faces/faces.py

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
text = input()
2+
text = text.replace(":)","🙂")
3+
text = text.replace(":(", "🙁")
4+
print(text)

Week0/indoor/indoor.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
text = input()
2+
text = text.lower()
3+
print(text)

Week0/playback/playback.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
text = input()
2+
text = text.replace(" ","...")
3+
print(text)

Week0/tip/tip.py

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
def main():
2+
dollars = dollars_to_float(input("How much was the meal? "))
3+
percent = percent_to_float(input("What percentage would you like to tip? "))
4+
tip = dollars * percent
5+
print(f"Leave ${tip:.2f}")
6+
7+
# meal
8+
def dollars_to_float(d):
9+
d = d.replace("$","")
10+
return float(d)
11+
12+
# percent
13+
def percent_to_float(p):
14+
p = p.replace("%","")
15+
p = float(p)
16+
p = p / 100
17+
return p
18+
19+
main()

0 commit comments

Comments
 (0)