2.
a) Guess the Number: Write a program that tells the player that it has come up with
a secret number and will give the player six chances to guess it. The code that lets the
player enter a guess and checks that guess is in a for loop that will loop at most six
times.
number=18
print('Welcome to guess game,Enter your name to get started with.')
Name=str(input())
print('Welcome',Name, 'You can guess a number between 1 and 20 and you will get six chances to
guess that number')
i=6
for i in range(6,0,-1):
print("Enter your guess:")
guessed_number=int(input())
if guessed_number==number:
print('Wow Congratulations!, Your guess is correct.')
break
else:
print('try again!,you have '+ str(int(i-1)) + ' chances left')
i=i-1
continue
if i==0:
print('Thank You..Your chances are over..better luck next time')