Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8fbeed0

Browse files
Modify file handle, update documentation
1 parent 1f54536 commit 8fbeed0

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

‎Tarot Reader/tarot_card_reader.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
for card in cards:
99
tarot_deck.append(card)
1010

11+
12+
# Close file, display outro text
1113
def fin():
14+
file_handle.close()
1215
print("Whichever your choice was...")
1316
input(">> press enter")
1417
print("May the cards ever be in your favour")
@@ -18,6 +21,7 @@ def fin():
1821
print("*"*72)
1922

2023

24+
# Display when 'Y' or 'y' is entered
2125
def youve_chosen_yes():
2226
print("I see that you've chosen to divine your future....")
2327
input(">> press enter")
@@ -46,6 +50,7 @@ def youve_chosen_yes():
4650
fin()
4751

4852

53+
# Display when 'N' or 'n' is entered
4954
def youve_chosen_no():
5055
print("Are you wise...")
5156
input(">> press enter")
@@ -56,6 +61,7 @@ def youve_chosen_no():
5661
fin()
5762

5863

64+
# Handles other cases
5965
def youve_chosen_neither():
6066
print("*le sigh*")
6167
input(">> press enter")
@@ -71,7 +77,7 @@ def youve_chosen_neither():
7177
fin()
7278

7379

74-
# Introductory lines
80+
# Intro text
7581
print("In this black box, you read white words")
7682
input(">> press enter")
7783
print("Words that might warn you of danger...")
@@ -82,13 +88,16 @@ def youve_chosen_neither():
8288
input(">> press enter")
8389
print()
8490

85-
# Choice to be made here
91+
92+
# Choice made here
8693
print("Do you dare draw a card?")
87-
ch = input(">> enter Y/N: ")
94+
ch = input(">> enter Y/n: ")
8895
print("\nInteresting...")
8996

97+
9098
# Driver code
9199
if ch.lower() == 'y':
100+
print()
92101
youve_chosen_yes()
93102

94103
elif ch.lower()=='n':

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /