Here's mine, you're pretty much right on track now. I thought I'd include this just to introduce a few new concepts and help you think a little more like a computer.
#!/usr/bin/env python
#This first line is really nifty, and all Linux users should be familiar with this.
# If you pass this file into python, the first line gets ignored, but if you pass it into bash or sh, then a # and a ! are called a magic byte, or whiz-bang for short
# They tell bash to open the rest of this file using the program and arguments passed on the first line.
# So this line changes my python script into a bash program, and if I had saved this as /tmp/myguess.py, I could then, from a bash prompt type in /tmp/myguess.py to run it
from random import randint
# Right after the first line, it's polite to import all your libraries and functions right at the top. This particular one says I want, from the "random" library to get a function called "randint"
# randint returns a random integer in a specified range
# The rest of the file is my actual program
answer = randint(0,10)
guess = int() # this is called an uninitialized integer. It has the space of ram allocated, but no value placed in it yet. These tend to be about 100x faster than initialized data types
while guess is not answer: #same thing as guess != answer
if guess is int(): # I only want something printed after they've guessed
pass
else:
print("Wrong.")
#Since this part is at the same indentation level as the if and else, it will always get executed
g = input("Guess my number: ")
guess = int(g)
print("Correct!")