Added sample files for day 2 and 3

This commit is contained in:
cheezedoodle2
2023-03-31 12:03:53 -07:00
parent 8f30f2b39b
commit 81a2c615bc
8 changed files with 123 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
class TomatoPrice:
price: float
def __init__(self, value):
self.price = value
def __str__(self):
return f"USD${self.price}"
def __radd__(self, operand):
self.price += operand.price
b'abcdefg'
str = b.encode('UTF-8')
for c in str:
if ord(c) >= 32 and ord(c) < 127:
print(c)
vietnam = TomatoPrice(3.0)
japan = TomatoPrice(4.0)
korea = TomatoPrice(5.0)
vietnam + japan
output = "price of tomatoes in countries A, B, C: " + str(vietnam) + " " + str(japan) + " " + str(korea) + " "
print(output)