Beginner's Number Guessing Game I've started learning to program, and as the first program I wrote on my own I wanted to come up with a number guessing game - the below is what I got.
I'm mainly looking for a review of my Guess function, but I do have a few specific questions:

Does it make sense to have my loop variable as a function parameter?
I'm currently defining some variables (e.g. tries) outside of my function - is this an idiomatic way to do it?

import random
tries = [1]
def Guess(playing):
    number = random.randint(1,100)
    print(number)
    print(&quot;We are going to play high and low, the avabile numbers are from 1 to 100 included.&quot;)
    while playing == True:
        user_input = input(&quot;What is your number? &quot;)
        if int(user_input) == number:
            print(&quot;You have won!&quot;)
            playing = False
        elif int(user_input) &lt; number:
            print(&quot;You need to give a higher number&quot;)
            tries.append(1)
        elif int(user_input) &gt; number:
            print(&quot;You need to give an lower number&quot;)
            tries.append(1)
        else:
            print(&quot;You have put an wrong number&quot;)
            playing = False
    print(&quot;It took you &quot; + str(sum(tries)) + &quot; turns to guess&quot;)
    still = input(&quot;Do you want to play again?&quot;)
    if still == &quot;yes&quot; or still == &quot;YES&quot; or still == &quot;y&quot; or still == &quot;si&quot;:
        Guess(playing=True)
    else:
        playing=False

Guess(playing=True)
Overall you've done a good job with your code, there are a couple things I'd look out for :

You aren't paying for whitespace! What I mean is that it's important to let your
code breathe. Use some empty lines, it'll do wonder for your eyes when dealing with big chunks of code.
Why is tries an array? In my opinion, tries should represent the number of tries, so it should be a number!
Notice that you have for conditions, ==, &lt;, &gt; and... ? Say I ask you to give me a number that is neither equal, smaller or greater than 3, is there a possible option? What you should do instead is make sure the player input a number! Right now, if I was to answer &quot;I don't know my numbers I'm just a baby&quot; to &quot;We are going to play high and low, the avabile numbers are from 1 to 100 included.&quot;, your program will crash! You should look into try/catch blocks to solve this problem, that could be a next thing to learn for you!
Say I need three tries on my first playthrough, then I start a new game (using &quot;yes&quot; when prompted) and I'm able to succeed on the first try, your code will tell me I've needed four tries to succeed. Can you find out why and how you can fix that?
You could simplify your loop using the break keyword, that's also something you should search for (while we're at it, try to understand the usage of break, return and continue. Those three keywords are pretty useful, although you probably already know about return).
What if I'm an english major and I can't stand making grammar mistakes (It's obviously not my case) and I write &quot;Yes&quot;, instead of &quot;yes&quot; or &quot;YES&quot;, when asked if I want to play again? What you could do is compare the lowered (or uppered) version of the input with what you want to check (ex. still.lower() == &quot;yes&quot;).