请编写一个简单的Python程序，让用户猜一个随机生成的数字。
确定随机生成的数字范围，并确定用户可以进行多少次猜测。
以下是一个简单的Python程序示例，让用户猜测1到10之间的随机数，用户可以进行3次猜测：

```python
import random

number = random.randint(1, 10)
guesses_left = 3

print("I'm thinking of a number between 1 and 10.")

while guesses_left > 0:
    guess = int(input("Guess my number: "))
    guesses_left -= 1
    
    if guess == number:
        print("Congratulations! You guessed my number!")
        break
    elif guess < number:
        print("Your guess is too low.")
    else:
        print("Your guess is too high.")
        
if guesses_left == 0:
    print("Sorry, you didn't guess my number. It was", number)
```

程序首先使用`random`模块生成1到10之间的随机数`number`。程序接着提示用户进行猜测。用户有3次猜测机会，每次猜测完后，剩余猜测次数`guesses_left`减1。如果用户猜对了，程序使用`break`语句退出循环，并输出“Congratulations! You guessed my number!”。如果用户没有在3次内猜出数字，程序会输出“Sorry, you didn't guess my number. It was”和正确的数字`number`。