Skip to content

Commit 1f8cd47

Browse files
PrashantPrashant
Prashant
authored and
Prashant
committed
Made Number guessing Program using High Low
1 parent 6e30e5e commit 1f8cd47

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

Scope.py

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import random
2+
3+
print ("Welcome tothe Num Guessing Game! ")
4+
print ("I'm thinking of a num betn 1 - 100 ")
5+
6+
comp = random.randint(1,100)
7+
8+
level = input (" Choose a difficulty type: 'easy' or 'hard' ")
9+
10+
if level == 'easy' :
11+
turns = 10
12+
print("You have only 10 attempts for guessing")
13+
else:
14+
turns = 5
15+
print ("You have only 5 attempts for guessing")
16+
17+
18+
guess = int(input("Make a guess: "))
19+
20+
while not guess == comp :
21+
22+
if guess > comp :
23+
print ("Too High")
24+
turns = turns - 1
25+
print (f"You have only {turns} attempts for guessing")
26+
guess = int(input("Make a guess: "))
27+
28+
elif guess < comp :
29+
print ("Too Low")
30+
turns = turns -1
31+
print (f"You have only {turns} attempts for guessing")
32+
guess = int(input("Make a guess: "))
33+
34+
else :
35+
print("Right Guess")
36+
else:
37+
print("Right Guess")

blackJack_game/blackjack.py

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
def deal_card():
1515
cards = [11, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10]
16+
1617
card = random.choice(cards)
1718
return card
1819

0 commit comments

Comments
 (0)