The code below is one of my earliest Python codes and I find it terribly cute :3
My code input:
print("WELCOME TO PYPET")
bunny = {
"name" : "Muffy",
"hungry": False,
"weight": 5.4,
"age": 4,
"photo": "(-'.'-)",
}
bird = {
"name": "Bell",
"hungry": True,
"weight": 0.7,
"age": 2,
"photo": "(v)",
}
print("Hello " + bunny["name"] + "!")
print(bunny["photo"])
print("- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ")
print("Hello " + bird["name"] + "!")
print(bird["photo"])
def feed(pet):
if pet["hungry"] == True:
pet["hungry"] = False;
pet["weight"] = pet["weight"] + 1
else:
print("The Pypet is not hungry.")
pets = [bunny, bird]
print("- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ")
for pet in pets:
feed(pet)
print(pet)
print("- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ")
print("It seems all is well here!")
print(bunny["photo"] + "<3 " + bird["photo"] + "<3 ")
My code output:
WELCOME TO PYPET
Hello Muffy!
(-'.'-)
Hello Bell!
(v)
The Pypet is not hungry.
{'name': 'Muffy', 'hungry': False, 'weight': 5.4, 'age': 4, 'photo': "(-'.'-)"}
{'name': 'Bell', 'hungry': False, 'weight': 1.7, 'age': 2, 'photo': '(v)'}
It seems all is well here!
(-'.'-)<3 (v)<3
A screenshot of my code input and output:
Run my Pypet program on Sololearn: https://www.sololearn.com/compiler-playground/cc7aEOtvMmUi
I do not feel the least bad about my old code. It is what it is. It was a start, my start and we all have to start somewhere!
Are you ashamed of your old code?