这是我见过最有趣的脚本O(∩_∩)O 欢迎围观!!!
from sys import exit def today(): print("What day is it today?") choice = input(">> ") if "Saturday" in choice or "Sunday" in choice: go_out() else: go_to_hospital() def go_out (): print("It's a sunny day.") print("What do you want to do?") choice = input(">> ") if "go out" in choice or "play" in choice: print("That sounds great.I'd like to go with you.") elif "at home" in choice: print("Good idea!") elif "no idea" in choice or "no plan" in choice: see_a_movie() else: print("Cool!Have a good time.") def see_a_movie (): print("I heard that Jiangziya has been shown. Are you going to see it?") choice = input(">> ") if "No" in choice: print("What a pity.") elif "Yes" in choice or "Of course" in choice or "can't wait" in choice: print("Great! Let's go together.") vehicle() else: print("Alright.") def vehicle(): print("How do we get there?") print("Take a taxi or the subway?") good_choice = False while True: choice = input(">> ") if "taxi" in choice: dead("Alright.That's what I thought.") elif "subway" in choice and not good_choice: print("I'm worried that there're too many people on it.") good_choice = False else: print("Are you sure?") good_choice = False def go_to_hospital(): print("Oh,yes.We have a meeting a few minutes.") print("Hey,Lucy.You don't look well.") print("What's wrong with you?") symptom = input(">> ") if "headache" in symptom or "sore throat" in symptom: print("Do you have a fever?") Answer = input(">> ") if "Yes" in Answer or "Yeah" in Answer: print("Gosh, you've caught a bad cold. We'd better go to hospital.") vehicle() else: print("Thank heavens.I'll go out and buy some medicine for you.") elif "stomachache" in symptom: print("You'd better take some hot water and have a good rest.") else: print("Sorry to hear that.What can I do for you?") def dead(A): print(A) exit(0) today()