-5

I need help in writing a program that allows the user to enter 10 different integers. If the user tries to enter an integer that has already been entered, the program will alert the user immediately and prompt the user to enter another integer. When 10 different integers have been entered, the average of these 10 integers is displayed.

try:
    raw_input("enter number: ")                                                           

I've entered this 10 times which allows me to enter 10 integers, but I am not sure how to alert the user when they have entered an integer that has already been entered. Is it something like this?

except ValueError:
        print("integer already entered")                                                               

I also not too sure how to calculate the average I'm sorry for being vague I have been stuck on this for too long since I am a beginner.

Thank you if u can help

  • 2
    Help with which part of the program? I don't think writing a program from start to finish is a specific problem. – Dan Getz Jun 23 '15 at 01:51
  • 2
    Homework should be attempted. – Mitch Wheat Jun 23 '15 at 01:51
  • 3
    Sounds like you are asking us to do your homework, which isn't what we're here for. Post some code as well as what you are getting stick on with the solution. We're here to help you learn and that means we'll help you get your work done, not do it for you. – Dave Long Jun 23 '15 at 01:51
  • try: num = int(input("enter number: ")) I've entered this 10 times which allows me to enter 10 integers, but I am not sure how to alert the user when they have entered an integer that has already been entered. Is it something like this? except ValueError: print("integer already entered") I also not too sure how to calculate the average – steven okeya Jun 23 '15 at 02:11

1 Answers1

0

As other have pointed out, your question is too broad and you have not provided evidence of even attempting the problem.

Regardless, here are a few steps to get you started:

Community
  • 1
  • 1
user3636636
  • 2,409
  • 2
  • 16
  • 31