└── balance /balance: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | 3 | def collect_user_input(): 4 | activities = { 5 | 'Work': int(input("Enter hours per week for Work: ")), 6 | 'Family Time': int(input("Enter hours per week for Family Time: ")), 7 | 'Hobbies': int(input("Enter hours per week for Hobbies: ")), 8 | 'Recreation': int(input("Enter hours per week for Recreation: ")), 9 | 'Sports': int(input("Enter hours per week for Sports: ")), 10 | 'Personal Care': int(input("Enter hours per week for Facial and Body Care: ")), 11 | 'Nutrition': int(input("Enter hours per week for Proper Nutrition: ")) 12 | } 13 | return activities 14 | 15 | def distribute_hours(activities): 16 | days_of_week = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'] 17 | weekly_schedule = {day: [] for day in days_of_week} 18 | 19 | for activity, hours in activities.items(): 20 | daily_hours = hours / 7 21 | for day in days_of_week: 22 | weekly_schedule[day].append((activity, daily_hours)) 23 | 24 | return weekly_schedule 25 | 26 | def create_schedule(weekly_schedule): 27 | df = pd.DataFrame(weekly_schedule) 28 | df.index = ['Work', 'Family Time', 'Hobbies', 'Recreation', 'Sports', 'Personal Care', 'Nutrition'] 29 | return df 30 | 31 | def display_schedule(schedule): 32 | print("Optimal Weekly Schedule:") 33 | print(schedule) 34 | 35 | def main(): 36 | activities = collect_user_input() 37 | weekly_schedule = distribute_hours(activities) 38 | schedule = create_schedule(weekly_schedule) 39 | display_schedule(schedule) 40 | 41 | if __name__ == "__main__": 42 | main() 43 | --------------------------------------------------------------------------------