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

  • SEARCH
  • Home
  • 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 3317840
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:38:04+00:00 2026-05-17T22:38:04+00:00

I need some guidance on how best to run this program. Im trying to

  • 0

I need some guidance on how best to run this program. Im trying to come up with a python program that accepts input from the user and prints them out until the word quit is inputted in which the program quits but not before printing the inputs twice..

For example

2.0′
6.0
3.5
quit
2.0
6.0
3.5
2.0
6.0
3.5

Thanks so much for helping =)

inputs = []

inp = raw_input(" Enter number or quit: ")

while inp!="quit":  
        inp = float(inp)
        inputs.append(inp)  
        inp = raw_input("Enter number or quit': ")



if inp == "quit":  
    print inputs, "quit", inputs * 2

now how do i get them on seperate lines?

  • 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-05-17T22:38:04+00:00Added an answer on May 17, 2026 at 10:38 pm

    Edited to improve visual clarity:

    1 #!/usr/bin/env python
    2 
    3 if __name__ == "__main__":
    4   inputs = []
    5   while True:
    6     inp = raw_input("Enter number|`quit': ")
    7     if inp.lower() == "quit":
    8       break
    9     try: inp = float(inp)
    10     except:
    11       print "Not a number, ignored"
    12       continue
    13     print inp
    14     inputs.append(inp)
    15   for i in inputs: print i
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need some performance improvement guidance, my query takes several seconds to run and
I am trying to set PastEvents, a int, and need some guidance in how
I need some help from the shell-script gurus out there. I have a .txt
We need some input on what is a good design pattern on using AJAX
Possible Duplicate: I need some guidance on payment gateways hi, i have a web
i have a input tag which is non editable, but some times i need
I need some guidance in how to debug problems with concurrency in Cocoa under
Need some help for creating a File and String search engine. The program needs
I need some advice as to how I easily can separate test runs for
I need some info on how to use margins and how exactly padding works.

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.