Projektmappe Python
Projektmappe Python
class Life:
#Happy
[Link] = 50
#progress
[Link] = 100
#Alien
[Link] = True
[Link] = 100
[Link] = 100
[Link] = 100
def to_sleep(self): print("I will sleep.") [Link] += 3 def to_chill(self): print("rest time") [Link] += 5 [Link] -= 0.1
def is_alive(self): if [Link] < 50: print("You are broke.") [Link] = False
if [Link] < 0:
print("You are a suicide lover. ;)")
[Link] = False
live_cube = randint(1,3)
if live_cube == 1:
self.to_work()
elif live_cube == 2:
self.to_chill()
elif live_cube == 3:
self.to_sleep()
self.end_of_day()
self.is_alive()
Max = Life("Max") for day in range(25550): if day == 25549: print ("You had a great life! Thank you for passing Max' life)") if [Link] == False: break
[Link](day)
#Happy
[Link] = 50
#progress
[Link] = 100
#Alien
[Link] = True
[Link] = 100
[Link] = 100
[Link] = 100
def to_work(self): print("Time to work! :((((") [Link] += 50 [Link] -= 3 [Link] -= 40 [Link] -= 30 [Link] -= 5
def to_sleep(self): print("Max will sleep.") [Link] += 3 [Link] += 5 [Link] -= 5 def to_chill(self): print("rest time") [Link] += 5 [Link] -= 10
if [Link] < 0:
print("Max is a suicide lover. ;)")
[Link] = False
if [Link] <= 0:
print("Max died from sickness:(")
[Link] = False
if [Link] <= 0:
print("Max died from hunger:(")
[Link] = False
if [Link] <= 0:
print("Max died from thirst:(")
[Link] = False
def end_of_day(self): print(f"Gladness = {[Link]}") print(f"Money = {[Link]}") print(f"Hunger = {[Link]}") print(f"Thirst = {[Link]}") print(f"Health = {[Link]}")
print()
live_cube = randint(1,7)
if live_cube == 1:
self.to_work()
elif live_cube == 2:
self.to_chill()
elif live_cube == 3:
self.to_sleep()
elif live_cube == 4:
self.to_doctor()
elif live_cube == 5:
self.to_drink()
elif live_cube == 6:
self.to_eat()
elif live_cube == 7:
self.to_goThroughtTrash()
self.end_of_day()
self.is_alive()
print('Max Carter is 20 years old, living in a cramped studio apartment on the rougher side of the city. He grew up in a quiet suburban neighborhood, but life fell apart fast after high
school. His parents divorced, money got tight, and Max decided to move out early to avoid being a burden. He thought independence would feel freeing—but instead, it felt like a slow
dive into chaos He works part-time jobs whenever he can find them—stocking shelves at night, delivering food on an old bike, or helping out at a local garage. But no matter how hard he
tries, the bills stack up faster than his paychecks. His fridge is often empty, his phone bill is always overdue, and his dreams keep getting pushed aside “until next month.” Will you help
him to live?') first_decision = int(input('yes or no? 1 = yes; no = 2: ')) if first_decision == 2: print('Look what you did: ') Max = Life("Max") for day in range(25550): if day == 25549: print
("Max had a great life! Thank you for passing Max' life)") if [Link] == False: break
[Link](day)
if first_decision == 1:
class Life:
def __init__(self, name):
[Link] = name
#Happy
[Link] = 50
#progress
[Link] = 100
#Alien
[Link] = True
[Link] = 100
[Link] = 100
[Link] = 100
def to_work(self):
[Link] += 50
[Link] -= 3
[Link] -= 40
[Link] -= 30
[Link] -= 5
def to_sleep(self):
[Link] += 3
[Link] += 5
[Link] -= 5
def to_chill(self):
print("rest time")
[Link] += 5
[Link] -= 10
def to_doctor(self):
[Link] += 40
[Link] -= 40
def to_eat(self):
print('Max ate!')
[Link] += 50
[Link] += 10
[Link] -= 15
[Link] += 5
def to_drink(self):
print('Max drank!')
[Link] += 40
[Link] -= 5
[Link] += 5
def to_goThroughtTrash(self):
[Link] += 30
[Link] += 10
[Link] -= 30
def is_alive(self):
print("Max is broke.")
[Link] = False
if [Link] < 0:
[Link] = False
if [Link] <= 0:
[Link] = False
if [Link] <= 0:
[Link] = False
if [Link] <= 0:
[Link] = False
def end_of_day(self):
print(f"Gladness = {[Link]}")
print(f"Money = {[Link]}")
print(f"Hunger = {[Link]}")
print(f"Thirst = {[Link]}")
print(f"Health = {[Link]}")
print()
def live(self, day):
live_cube = randint(1,7)
if live_cube == 1:
self.to_work()
elif live_cube == 2:
self.to_chill()
elif live_cube == 3:
self.to_sleep()
elif live_cube == 4:
self.to_doctor()
elif live_cube == 5:
self.to_drink()
elif live_cube == 6:
self.to_eat()
elif live_cube == 7:
self.to_goThroughtTrash()
self.end_of_day()
self.is_alive()
class LifeyourChoice:
[Link] = name
#Happy
[Link] = 50
#progress
[Link] = 100
#Alien
[Link] = True
[Link] = 100
[Link] = 100
[Link] = 100
def to_work(self):
[Link] += 50
[Link] -= 3
[Link] -= 40
[Link] -= 30
[Link] -= 5
def to_sleep(self):
[Link] += 3
[Link] += 5
[Link] -= 5
def to_chill(self):
print("rest time")
[Link] += 5
[Link] -= 10
def to_doctor(self):
[Link] += 40
[Link] -= 40
def to_eat(self):
print('Max ate!')
[Link] += 50
[Link] += 10
[Link] -= 15
[Link] += 5
def to_drink(self):
print('Max drank!')
[Link] += 40
[Link] -= 5
[Link] += 5
def to_goThroughtTrash(self):
[Link] += 30
[Link] += 10
[Link] -= 30
def is_alive(self):
print("Max is broke.")
[Link] = False
if [Link] < 0:
[Link] = False
if [Link] <= 0:
[Link] = False
if [Link] <= 0:
[Link] = False
if [Link] <= 0:
[Link] = False
def end_of_day(self):
print(f"Gladness = {[Link]}")
print(f"Money = {[Link]}")
print(f"Hunger = {[Link]}")
print(f"Thirst = {[Link]}")
print(f"Health = {[Link]}")
print()
print('Max Carter is 20 years old, living in a cramped studio apartment on the rougher side of the city. He grew up in a quiet suburban neighborhood, but life fell apart fast after high
school. His parents divorced, money got tight, and Max decided to move out early to avoid being a burden. He thought independence would feel freeingâ”but instead, it felt like a slow
dive into chaos. He works part-time jobs whenever he can find them â” stocking shelves at night, delivering food on an old bike, or helping out at a local garage. But no matter how hard
he tries, the bills stack up faster than his paychecks. His fridge is often empty, his phone bill is always overdue, and his dreams keep getting pushed aside âœuntil next month.â Will
you help him to live?')
if first_decision == 2:
Max = Life("Max")
for day in range(25550):
if day == 25549:
print ("Max had a great life! Thank you for passing Max' life)")
if [Link] == False:
break
[Link](day)
if first_decision == 1:
Max = LifeyourChoice("Max")
if day == 25549:
print ("Max had a great life! Thank you for passing Max' life)")
if [Link] == False:
break
[Link](day)
19.12.2025 2. Stunde Elena
from random import * class Life:
#Happy
[Link] = 50
#progress
[Link] = 100
#Alien
[Link] = True
[Link] = 100
[Link] = 100
[Link] = 100
def to_work(self): print("Time to work! :((((") [Link] += 50 [Link] -= 3 [Link] -= 40 [Link] -= 30 [Link] -= 5
def to_sleep(self): print("Max will sleep.") [Link] += 3 [Link] += 5 [Link] -= 5 def to_chill(self): print("rest time") [Link] += 5 [Link] -= 10
if [Link] < 0:
print("Max is a suicide lover. ;)")
[Link] = False
if [Link] <= 0:
print("Max died from sickness:(")
[Link] = False
if [Link] <= 0:
print("Max died from hunger:(")
[Link] = False
if [Link] <= 0:
print("Max died from thirst:(")
[Link] = False
def end_of_day(self): print(f"Gladness = {[Link]}") print(f"Money = {[Link]}") print(f"Hunger = {[Link]}") print(f"Thirst = {[Link]}") print(f"Health = {[Link]}")
print()
def live(self, day): print(f"Day - {day} of {[Link]}")
live_cube = randint(1,7)
if live_cube == 1:
self.to_work()
elif live_cube == 2:
self.to_chill()
elif live_cube == 3:
self.to_sleep()
elif live_cube == 4:
self.to_doctor()
elif live_cube == 5:
self.to_drink()
elif live_cube == 6:
self.to_eat()
elif live_cube == 7:
self.to_goThroughtTrash()
self.end_of_day()
self.is_alive()
class LifeyourChoice:
#Happy
[Link] = 50
#progress
[Link] = 100
#Alien
[Link] = True
[Link] = 100
[Link] = 100
[Link] = 100
def to_work(self): print("Time to work! :((((") [Link] += 50 [Link] -= 3 [Link] -= 40 [Link] -= 30 [Link] -= 5
if [Link] < 0:
print("Max is a suicide lover. ;)")
[Link] = False
if [Link] <= 0:
print("Max died from sickness:(")
[Link] = False
if [Link] <= 0:
print("Max died from hunger:(")
[Link] = False
if [Link] <= 0:
print("Max died from thirst:(")
[Link] = False
def end_of_day(self): print(f"Gladness = {[Link]}") print(f"Money = {[Link]}") print(f"Hunger = {[Link]}") print(f"Thirst = {[Link]}") print(f"Health = {[Link]}")
print()
YourChoice = int(input('What do you want to do? 1 = work and earn money; 2 = sleep; 3 = chill; 4 = going to the doctor; 5 =
eat; 6 = drink; 7 = going through trash cans: '))
if YourChoice == 1:
self.to_work()
elif YourChoice == 2:
self.to_sleep()
elif YourChoice == 3:
self.to_chill()
elif YourChoice == 4:
self.to_doctor()
elif YourChoice == 5:
self.to_eat()
elif YourChoice == 6:
self.to_drink()
elif YourChoice == 7:
self.to_goThroughtTrash()
print('Max Carter is 20 years old, living in a cramped studio apartment on the rougher side of the city. He grew up in a quiet suburban neighborhood, but life fell apart fast after high
school. His parents divorced, money got tight, and Max decided to move out early to avoid being a burden. He thought independence would feel freeing—but instead, it felt like a slow
dive into chaos. He works part-time jobs whenever he can find them — stocking shelves at night, delivering food on an old bike, or helping out at a local garage. But no matter how hard
he tries, the bills stack up faster than his paychecks. His fridge is often empty, his phone bill is always overdue, and his dreams keep getting pushed aside “until next month.” Will you help
him to live?') first_decision = int(input('yes or no? 1 = yes; no = 2: ')) if first_decision == 2: print('Look what you did: ') Max = Life("Max") for day in range(25550): if day == 25549: print
("Max had a great life! Thank you for passing Max' life)") if [Link] == False: break
[Link](day)
if first_decision == 1: Max = LifeyourChoice("Max") for day in range(25550): if day == 25549: print ("Max had a great life! Thank you for passing Max' life)") if [Link] == False: break
[Link](day)
09.01.2026 2. Stunde Veronika&Elena
from random import * #bibliothek
class Life:
#computer entscheidet
[Link] = name
#Happy
[Link] = 50
#progress
[Link] = 100
#Alien
[Link] = True
[Link] = 100
[Link] = 100
[Link] = 100
def to_work(self):
[Link] += 50
[Link] -= 3
[Link] -= 40
[Link] -= 30
[Link] -= 5
def to_sleep(self):
[Link] += 3
[Link] += 5
[Link] -= 5
def to_chill(self):
print("rest time")
[Link] += 5
[Link] -= 10
def to_doctor(self):
[Link] += 40
[Link] -= 40
def to_eat(self):
print('Max ate!')
[Link] += 50
[Link] += 10
[Link] -= 15
[Link] += 5
def to_drink(self):
print('Max drank!')
[Link] += 40
[Link] -= 5
[Link] += 5
def to_goThroughtTrash(self):
[Link] += 30
[Link] += 10
[Link] -= 30
def is_alive(self):
print("Max is broke.")
[Link] = False
if [Link] < 0:
[Link] = False
if [Link] <= 0:
[Link] = False
if [Link] <= 0:
[Link] = False
if [Link] <= 0:
[Link] = False
#stats ausgeben
def end_of_day(self):
print(f"Gladness = {[Link]}")
print(f"Money = {[Link]}")
print(f"Hunger = {[Link]}")
print(f"Thirst = {[Link]}")
print(f"Health = {[Link]}")
print()
live_cube = randint(1,7)
if live_cube == 1:
self.to_work()
elif live_cube == 2:
self.to_chill()
elif live_cube == 3:
self.to_sleep()
elif live_cube == 4:
self.to_doctor()
elif live_cube == 5:
self.to_drink()
elif live_cube == 6:
self.to_eat()
elif live_cube == 7:
self.to_goThroughtTrash()
self.end_of_day()
class LifeyourChoice:
[Link] = name
#Happy
[Link] = 50
#progress
[Link] = 100
#Alien
[Link] = True
[Link] = 100
[Link] = 100
[Link] = 100
def to_work(self):
[Link] += 50
[Link] -= 3
[Link] -= 40
[Link] -= 30
[Link] -= 5
def to_sleep(self):
[Link] += 3
[Link] += 5
[Link] -= 5
def to_chill(self):
print("rest time")
[Link] += 5
[Link] -= 10
def to_doctor(self):
print("Max is going to the doctor.")
[Link] += 40
[Link] -= 40
def to_eat(self):
print('Max ate!')
[Link] += 50
[Link] += 10
[Link] -= 15
[Link] += 5
def to_drink(self):
print('Max drank!')
[Link] += 40
[Link] -= 5
[Link] += 5
def to_goThroughtTrash(self):
[Link] += 30
[Link] += 10
[Link] -= 30
def is_alive(self):
print("Max is broke.")
[Link] = False
if [Link] < 0:
[Link] = False
if [Link] <= 0:
[Link] = False
if [Link] <= 0:
if [Link] <= 0:
[Link] = False
YourChoice = int(input('What do you want to do? 1 = work and earn money; 2 = sleep; 3 = chill; 4 = going to the doctor; 5 = eat; 6 = drink;
7 = going through trash cans: '))
if YourChoice == 1:
self.to_work()
print(f"Gladness = {[Link]}")
print(f"Money = {[Link]}")
print(f"Hunger = {[Link]}")
print(f"Thirst = {[Link]}")
print(f"Health = {[Link]}")
print()
elif YourChoice == 2:
self.to_sleep()
print(f"Gladness = {[Link]}")
print(f"Money = {[Link]}")
print(f"Hunger = {[Link]}")
print(f"Thirst = {[Link]}")
print(f"Health = {[Link]}")
print()
elif YourChoice == 3:
self.to_chill()
print(f"Gladness = {[Link]}")
print(f"Money = {[Link]}")
print(f"Hunger = {[Link]}")
print(f"Thirst = {[Link]}")
print(f"Health = {[Link]}")
print()
elif YourChoice == 4:
self.to_doctor()
print(f"Gladness = {[Link]}")
print(f"Money = {[Link]}")
print(f"Hunger = {[Link]}")
print(f"Thirst = {[Link]}")
print(f"Health = {[Link]}")
print()
elif YourChoice == 5:
self.to_eat()
print(f"Gladness = {[Link]}")
print(f"Money = {[Link]}")
print(f"Hunger = {[Link]}")
print(f"Thirst = {[Link]}")
print(f"Health = {[Link]}")
print()
elif YourChoice == 6:
self.to_drink()
print(f"Gladness = {[Link]}")
print(f"Money = {[Link]}")
print(f"Hunger = {[Link]}")
print(f"Thirst = {[Link]}")
print(f"Health = {[Link]}")
print()
elif YourChoice == 7:
self.to_goThroughtTrash()
print(f"Gladness = {[Link]}")
print(f"Money = {[Link]}")
print(f"Hunger = {[Link]}")
print(f"Thirst = {[Link]}")
print(f"Health = {[Link]}")
print()
self.is_alive()
print('Max Carter is 20 years old, living in a cramped studio apartment on the rougher side of the city. He grew up in a quiet suburban
neighborhood, but life fell apart fast after high school. His parents divorced, money got tight, and Max decided to move out early to avoid
being a burden. He thought independence would feel freeing—but instead, it felt like a slow dive into chaos. He works part-time jobs
whenever he can find them — stocking shelves at night, delivering food on an old bike, or helping out at a local garage. But no matter how
hard he tries, the bills stack up faster than his paychecks. His fridge is often empty, his phone bill is always overdue, and his dreams keep
getting pushed aside “until next month.” Will you help him to live?')
Max = Life("Max")
if day == 25549:
print ("Max had a great life! Thank you for passing Max' life)")
if [Link] == False:
break
[Link](day)
if first_decision == 1:
Max = LifeyourChoice("Max")
if day == 25549:
print ("Max had a great life! Thank you for passing Max' life)")
if [Link] == False:
break
[Link](day)
Quellen:
Ausgangscode:
from random import *
class Student:
#Happy
[Link] = 50
#progress
[Link] = 0
#Alien
[Link] = True
def to_sleep(self): print("I will sleep.") [Link] += 3 def to_chill(self): print("rest time") [Link] += 5 [Link] -= 0.1
def is_alive(self): if [Link] < -0.5: print("You are a corp.") [Link] = False
if [Link] < 0:
print("You are a suicide lover. ;)")
[Link] = False
if [Link] > 5:
print("Guy, you are cool. You are not as dumb as I thought.")
[Link] = False
live_cube = randint(1,3)
if live_cube == 1:
self.to_study()
elif live_cube == 2:
self.to_chill()
elif live_cube == 3:
self.to_sleep()
self.end_of_day()
self.is_alive()
Max = Student("name")
if day == 364:
if [Link] == False:
break
[Link](day)
Max Carter is 20 years old, living in a cramped studio apartment on the rougher side of the city. He
grew up in a quiet suburban neighborhood, but life fell apart fast after high school. His parents
divorced, money got tight, and Max decided to move out early to avoid being a burden. He thought
independence would feel freeing—but instead, it felt like a slow dive into chaos He works part-time
jobs whenever he can find them—stocking shelves at night, delivering food on an old bike, or helping
out at a local garage. But no matter how hard he tries, the bills stack up faster than his paychecks. His
fridge is often empty, his phone bill is always overdue, and his dreams keep getting pushed aside
“until next month.”