Create a program that will generate lottery numbers for the user. There are two types of numbers in the lottery, the standard numbers 1-43 and the power ball number 1-60.There are three different lottery games, a three number game, a five number game with a power ball, and a seven number game with a power ball. Ask the user for the game type and number of lottery plays that they would like to purchase. The three number games is 1 dollar per play, the five number game is 2 dollars per play and the seven number game is 3 dollars per play.After each selection show the numbers selected in sorted order (assume that the order does not matter in determining the winner).When the user is done with their plays,display the total cost of the plays purchased. I'm stuck with this question, can someone help? Thanks JR

Tell us where you're stuck, what bugs you, and we'll start from there.

Certainly! I can guide you through the process of creating a program to generate lottery numbers based on the requirements you mentioned. Here's an outline of the steps you can follow:

1. Start by asking the user for the game type and the number of lottery plays they would like to purchase. You can use the `input()` function to get the user's input.

2. Based on the game type, generate the corresponding number of lottery plays with the specified format. Here's how you can do it for each game type:
- For the three-number game, generate three random numbers within the range 1-43.
- For the five-number game with a power ball, generate five random numbers within the range 1-43, and one random number within the range 1-60.
- For the seven-number game with a power ball, generate seven random numbers within the range 1-43, and one random number within the range 1-60.

3. Sort the generated numbers in ascending order. You can use the `sorted()` function to sort the numbers.

4. After each selection, display the selected numbers to the user. You can use the `print()` function for this.

5. Keep track of the total cost of the plays purchased. Multiply the number of plays with the corresponding cost per play for each game type.

6. Once the user is done with their plays, display the total cost of the plays purchased using the `print()` function.

Here's a sample code snippet to get you started:

```python
game_type = input("Enter the game type (3, 5, or 7): ")
num_plays = int(input("Enter the number of plays: "))

total_cost = 0

for _ in range(num_plays):
if game_type == '3':
numbers = sorted(random.sample(range(1, 44), 3))
total_cost += 1
elif game_type == '5':
numbers = sorted(random.sample(range(1, 44), 5) + [random.randint(1, 61)])
total_cost += 2
elif game_type == '7':
numbers = sorted(random.sample(range(1, 44), 7) + [random.randint(1, 61)])
total_cost += 3

print("Selected numbers:", numbers)

print("Total cost:", total_cost)
```

Make sure to import the `random` module at the beginning of your program to use the random number generation functions.

I hope this helps you get started with your program! Let me know if you have any further questions.