Skip to content

Commit e9fc84d

Browse files
author
Vniverse-70
committed
Fruit game
1 parent 05b02ff commit e9fc84d

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

apple.py

+15-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,15 @@
1-
print("i like apples! and another apple")
1+
import random
2+
3+
print("Do you like Fruits?")
4+
my_choice = input("Me: ").lower()
5+
linux_choices = ('apple', 'banana', 'orange', 'grapes', 'mango', 'pineapple', 'watermelon', 'kiwi', 'papaya', 'guava')
6+
linux_choice = random.choice(linux_choices)
7+
8+
if my_choice in linux_choices:
9+
if my_choice == linux_choice:
10+
print("I like it too")
11+
else:
12+
print(f"I prefer {linux_choice}")
13+
else:
14+
print("That's not a fruit I know!")
15+

0 commit comments

Comments
 (0)