7.3 num = int(input("Enter a number: ?")) if num % 10 == 0: print("It's an integral multiple of 10.") else: print("It's not an integral multiple of 10.") 7.5 while True: age = int(input("\nHow old are you ?\n ")) if age <= 3: print("You are free.") elif age > 3 and age <= 12: print("You are charged $10.") else: print("You are charged $12.") 7.7 index = 0 while True: print(index) index = index + 1 8.1 def display_message(): print("I learn function in this capter!") display_message() 8.2 def favorite_book(title): print("One of my favorite books is " + title + "!") favorite_book("Hello Python") 8.3 def make_shirt(size, message): print("The size of the shirt is " + str(size) + ", and the message on it is " + message + "!") make_shirt(10, "Hello Python")
第四周的作业
猜你喜欢
转载自blog.csdn.net/m0_37600543/article/details/79782238
今日推荐
周排行