Just a simple guessing game This is a simple guessing game I have made, an improvised one. I will do a GUI version of this shortly.

I'm looking for comments and interesting code ideas.

import random 

sec_no = random.randint(0, 10)

ncount = 0

att = 5

while True:
    sec_no = random.randint(0, 10)
    ncount = 0
    att = 4
    minp = input('''
                    1-start
                    2-help
                    3-quit
                 ''')

    if minp.lower() == 'start' or minp == '1':
        while ncount != 4:
            att -= 1

            try:
                uinp = int(input('Guess the no:'))
                if uinp == int(sec_no):
                    print('correct!!!!')   
                    break

                else:
                    print('incorrect!!!')
                    print(f'attempts left:{att}')

            except ValueError:
                print('invalid value!!!')
                print(f'attempts left:{att}')

            if ncount == 3:
                print('You lose!!')
                print(f'correct number is :{sec_no}')
                break

    ncount += 1

    elif minp.lower() == 'quit' or minp == '3':
        while True:
            print('are you sure you wanna quit?     [Y/N]')
            linp = input('&gt;')

            if linp.lower() == 'y':
                print('Thanks for playing!!')
                exit()

            elif linp.lower() == 'n':
                break

            else:
                print("I don't understand that!!!")

    elif minp.lower() == 'help' or minp == '2':
        print('''You will be given 3 attempts,within these attempts you'll have to 
                 guess the right number from 0-10
                 good luck!!!''')

    else:
        print("I don't understand that!!")
There are few improvements you can do:


Remove the first sec_no = random.randint(0, 10). You are already initializing it inside of the main while loop.
Create a variable that contains minp.lower(). Instead of calculating it over and over - keep it in a variable and avoid code duplication.
Get rid of ncout or att. They are practically saving the same thing, keep only att and change the while and if condition to att &gt; 0.
Add some comments - File comments and function comments.
General python tip: do not write code in main, Use functions. Function for each case, function for main loop, function to check if string is int and the __main__ should look like this:


if __name__ == '__main__':
    main_function()


Except for that - good logic, nice code :)