File tree Expand file tree Collapse file tree 1 file changed +14
-14
lines changed Expand file tree Collapse file tree 1 file changed +14
-14
lines changed Original file line number Diff line number Diff line change 1
1
import random
2
- userGuess = int ( input ( "Enter your guessed no. b/w 0-100:" ))
2
+
3
3
a = comGuess = random .randint (0 ,100 )
4
4
5
5
6
- while true :
7
- comGuess = random . randint ( 0 , 100 )
8
- if userGuess > comGuess :
9
- print ("Guess Higher" )
10
- comGuess = random .randint (a ,100 )
11
- a + +
6
+ while True :
7
+ userGuess = int ( input ( "Enter your guessed no. b/w 0- 100:" ) )
8
+ if userGuess < comGuess :
9
+ print ("Guess Higher" )
10
+ comGuess = random .randint (a ,100 )
11
+ a += 1
12
12
13
- elif userGuess < comGuess :
14
- print ("Guess Lower" )
15
- comGuess = random .randint (0 ,a )
16
- a + +
13
+ elif userGuess > comGuess :
14
+ print ("Guess Lower" )
15
+ comGuess = random .randint (0 ,a )
16
+ a += 1
17
17
18
- else :
19
- print ("Guessed Corectly" )
20
- break
18
+ else :
19
+ print ("Guessed Corectly" )
20
+ break
You can’t perform that action at this time.
0 commit comments