Hi there. I've rewrote your code, please try it out.
Before I post it, Just a few issues...
You want to make sure the player can input the number while they've got enough guesses, else the game might not work as expected.
So putting the input in the while loop solves the problem. What exactly was your issue any ways?
Edit: Oh and lastly, make sure you convert the user's input to an int as that's what you'd want to compare it with, a number (random number generated from random.randint is going to be an int. Just saying as you might face some issues in the future.Here is the code:
import random
def main():
number=random.randint(0,100)
chanses=10
while chanses>0:
choice=int(input("Please enter a number from 0 to 100"))
if choice==number:
print ("You guessed it!")
else:
chanses-=1
print (f"You've got {chanses} chanses left. Please try again.")
print (f"The number the computer thought of was {number}")
if __name__=="__main__":
main()
best regards
never give up on what ever you are doing.