Guess the number Feedback Please I started learning Python these days and made my first code. Guess_The_Number and I would like some comments to improve or if I am on the right track. Thank you very much in advance
P.s: I am trying to create my own function.
def guess_number (answer):
    trys = 0
        
    while trys &lt; 5:
        guessing = int(input(&quot;Your guessing is? &quot;))
        if guessing == answer:
            print (&quot;Yes!! it's Right!!&quot;)
            break
        elif guessing &lt; answer:
            print (&quot;Big&quot;)
        elif guessing &gt; answer:
            print (&quot;smaller&quot;)
        trys = trys+1
        
    if trys == 5:
        print(&quot;WoW, your trys are over  , try again!!&quot;)
        print(&quot;The number was &quot;, answer)
    
print(&quot;Welcome to guess the number!!&quot;)
print(&quot;You have 5 trys to guess the number&quot;)
print(&quot;Good Luck!!&quot;)
print(&quot;I'm thiking in a number from 0 to 100&quot;)
print('')
import random
num_right = random.randint(0,100)
guess_number(num_right)
This might seem a bit much, but I'm reviewing this as if it were intended for production code:

black and isort can reformat this code to be more idiomatic without changing the functionality.

pylint, flake8 or both can tell you of some issues with this code:
$ pylint --disable=missing-function-docstring,missing-module-docstring q.py 
************* Module q
q.py:3:0: C0303: Trailing whitespace (trailing-whitespace)
q.py:14:0: C0303: Trailing whitespace (trailing-whitespace)
q.py:6:8: R1723: Unnecessary &quot;elif&quot; after &quot;break&quot; (no-else-break)
q.py:23:0: C0413: Import &quot;import random&quot; should be placed at the top of the module (wrong-import-position)

------------------------------------------------------------------
Your code has been rated at 8.26/10


The plural of &quot;try&quot; is &quot;tries&quot;.

trys += 1 is syntactic sugar for trys = trys + 1.

The code mixes I/O (input/print) and logic, which generally makes the code harder to maintain. It might be better to split this into two functions, one to check the answer against the right answer, and one to receive input and print output.

To enable reuse of the code I would add a main function and the idiomatic
if __name__ == &quot;__main__&quot;:
    main()

lines at the bottom of the script to actually run it. Basically, if you just import your file into another nothing should print when importing it. Right now it's impossible to import cleanly from the script:
$ python
Python 3.9.1 (default, Dec 13 2020, 11:55:53) 
[GCC 10.2.0] on linux
Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
&gt;&gt;&gt; import q
Welcome to guess the number!!
You have 5 trys to guess the number
Good Luck!!
I'm thiking in a number from 0 to 100

Your guessing is?