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 495bba6

Browse files
Create randomnumber.py
1 parent cad56f5 commit 495bba6

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

‎R.LOKESH/task3/randomnumber.py‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import random
2+
3+
chance=0
4+
score=100
5+
number=random.randint(1,100)
6+
print(number)
7+
print("guessing number game you have 10 chances guess the number")
8+
while chance<10:
9+
guess=int(input("Enter any number:"))
10+
if guess==number:
11+
print("you guessed correct !!")
12+
score+=10
13+
break
14+
else:
15+
print("You are wrong retry")
16+
score-=10
17+
chance+=1
18+
print("your score is",score)
19+
print("your final score:",score)

0 commit comments

Comments
(0)

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