Question

Write a program that reads a series of numbers from standard input and prints a list containing those numbers. A sentinel valplease could you also do a little bit of explanation of how you did it please thank you

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Algorithm:

Code pasted for your information . Please give thumbs up

a=[]
while(1):
    num=input("Enter number")
    if(num==-999):
        break
    else:
        a.append(num)
print (a)
Add a comment
Know the answer?
Add Answer to:
please could you also do a little bit of explanation of how you did it please...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Solve only with python please and show a little bit of explanation thank you so i...

    Solve only with python please and show a little bit of explanation thank you so i can understand, i will thumbs up if correct :) Write a program that reads a series of numbers from standard input and prints a list containing those numbers. A sentinel value of -999 will indicate the end of the input values. Do not append the sentinel value onto the list. For example: Input Result 1 -999 Enter a number: 1 Enter a number: -999...

  • 1. Write a program that prompts the user to enter three integers and display the integers...

    1. Write a program that prompts the user to enter three integers and display the integers in non-decreasing order. You can assume that all numbers are valid. For example: Input Result 140 -5 10 Enter a number: Enter a number: Enter a number: -5, 10, 140 import java.util.Scanner; public class Lab01 { public static void main(String[] args) { Scanner input = new Scanner(System.in);    } } ---------------------------------------------------------------------------------------------------------------------------- 2. Write a program that repeatedly prompts the user for integer values from...

  • C++ assignment Write a program that reads a sequence of integers and prints the following: 1....

    C++ assignment Write a program that reads a sequence of integers and prints the following: 1. The number of odd and even numbers of inputs Use a sentinel value to signal the end of inputs. If the sentinel value is the first you enter, give a message “NO input is entered!”. Input Validation: Do not accept a negative number.

  • Please be detailed in your explanation. Thank You! 28. To detect input bit pattern 110 with...

    Please be detailed in your explanation. Thank You! 28. To detect input bit pattern 110 with a Moore type FSM, total number of states needed IS (a) 3 [to (c) 5 (d) 6 29, How to reach the final state of getting "1 10% from input? (a) Previous state of getting "11", input 0 (b) Previous state of getting "1 1", input 1 (c) Previous state of getting "10", input 0 (d) Previous state of getting "10", input 1

  • Please and thank you 2) (5 pts) Arrays & Vectors: write a program which prompts the...

    Please and thank you 2) (5 pts) Arrays & Vectors: write a program which prompts the user to enter numbers (terminated with a non-numeric), reads them simultaneously into an array of doubles and into a vector of doubles, then prints A) the array elements in the original order B) the vector elements in reverse order C) the average of the vector elements D) the largest of the vector elements Example program output, user input shown underlined Enter a list of...

  • Hello, can you please show me how to do this program with COMPLETE INPUT VALIDATION so...

    Hello, can you please show me how to do this program with COMPLETE INPUT VALIDATION so the computer tells the user to enter ints only if the user enters in floating point numbers or other characters? Write a method called evenNumbers that accepts a Scanner reading input from a file containing a series of integers, and report various statistics about the integers to the console. Report the total number of numbers, the sum of the numbers, the count of even...

  • Hello, Could you please explain how I would complete this program with input validation to ensure...

    Hello, Could you please explain how I would complete this program with input validation to ensure that an error message will not appear if the user enters something other than an integer that is not 1-100 and later if they enter anything other than yes and no? Here is the program: Write a program that plays the Hi-Lo guessing game with numbers. The program should pick a random number between 1 and 100 (inclusive), then repeatedly promt the user to...

  • /* I'm trying to write this program here but my problem is getting the program to...

    /* I'm trying to write this program here but my problem is getting the program to save the user input to "int data" but cannot because it is part of the struct. What do I have to do in order to get this to work? (Language is C++) Write a program that prompts the user to enter numbers on the screen and keep adding those numbers to a linked list. The program stops when user enters -999. Hint: Use a...

  • Could you please help me with an answer to this question in a simple way for...

    Could you please help me with an answer to this question in a simple way for the beginner? This is a beginner level class so can you please help me. The code must have beginner level implementation. Can you also please explain what things do. Thank you! Write a program that prompts the user for a positive integer number smaller than 256 (i.e. in [0...255]) and converts it into an 8-bit binary number. The bits are the remainders of the...

  • I need help with the following assignment: Write an application named DailyTemps that continuously prompts a...

    I need help with the following assignment: Write an application named DailyTemps that continuously prompts a user for a series of daily high temperatures until the user enters a sentinel value of 999. Valid temperatures range from -20 through 130 Fahrenheit. When the user enters a valid temperature, add it to a total; when the user enters an invalid temperature, display the error message: Valid temperatures range from -20 to 130. Please reenter temperature. Before the program ends, display the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT