Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8483769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:11:49+00:00 2026-06-10T20:11:49+00:00

I am trying to make a program that will ask a user to enter

  • 0

I am trying to make a program that will ask a user to enter a number and then ask them if they want to enter another number. Based on the numbers they enter the program will sum them and give the average of them.

Here is what I have so far but I understand it doesnt work. Any help is greatly appreciated.

a = int(input("Enter a number: "))
more = input("Please enter Y or N if you want to add more numbers: ")

def funct(more):
    while more == "Y":
        b = int(input("Enter another number: "))
        abSum = a + b
        abMean = a + b / 2
        if more == "Y":
            return b
        else:
            break

    print(abSum)
    print(abMean)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T20:11:51+00:00Added an answer on June 10, 2026 at 8:11 pm

    try something like:

    a = int(input("Enter a number: "))
    more = input("Please enter Y or N if you want to add more numbers: ")
    summ=a          #intialize sum to a
    count=1         # no. of integers entered, to calculate mean
    while more.lower()=="y":
        b = int(input("Enter another number: "))
        count+=1          #increase count by 1
        summ+= b          #add b to sum
        abMean = summ/float(count)         #used float(count) to get actual value
    
        print("sum=",summ)
        print("mean=",abMean)    
        more = input("Please enter Y or N if you want to add more numbers: ") #ask for user input
    print("sum=",summ)
    print("mean=",abMean)  
    

    output:

    Enter a number: 5
    Please enter Y or N if you want to add more numbers: y
    Enter another number: 5
    sum= 10
    mean= 5.0
    Please enter Y or N if you want to add more numbers: y
    Enter another number: 2
    sum= 12
    mean= 4.0
    Please enter Y or N if you want to add more numbers: y
    Enter another number: 15
    sum= 27
    mean= 6.75
    Please enter Y or N if you want to add more numbers: y
    Enter another number: 10
    sum= 37
    mean= 7.4
    Please enter Y or N if you want to add more numbers: n
    sum= 37
    mean= 7.4
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make a C function which will ask the user to enter
I am trying to make a program that will allow a user to view
I'm trying to make a program that will open a directory, then use regular
I am trying to make a program that will find similar images from a
Okay so I'm trying to make a little gag program that will run away
I'm trying to make a chat program, that will pull the server every 2
i'm trying to make a program that will connect two points that i click
I am trying to make a program that Encrypts data using AES, then encrypts
I am trying to make a program that will search for a file on
I'm trying to make a program that solves equations, i want the answer to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.