Based on Program.Py below, develop a list of requirements that could have been used to create the original Program.py (specify requirements in any format you desire) as written.   import random   guesses_made = 0   name = raw_input('Hello! What is your name?\n')   number = random.randint(1, 20) print 'Well, {0}, I am thinking of a number between 1 and 20.'.format(name)   while guesses_made < 6:       guess = int(raw_input('Take a guess: '))       guesses_made += 1       if guess < number:         print 'Your guess is too low.'       if guess > number:         print 'Your guess is too high.'       if guess == number:         break   if guess == number:     print 'Good job, {0}! You guessed my number in {1} guesses!'.format(name, guesses_made) else:     print 'Nope. The number I was thinking of was {0}'.format(number)

Question

Based on Program.Py below, develop a list of requirements that could have been used to create the original Program.py (specify requirements in any format you desire) as written.

 

import random

 

guesses_made = 0

 

name = raw_input('Hello! What is your name?\n')

 

number = random.randint(1, 20)

print 'Well, {0}, I am thinking of a number between 1 and 20.'.format(name)

 

while guesses_made < 6:

 

    guess = int(raw_input('Take a guess: '))

 

    guesses_made += 1

 

    if guess < number:

        print 'Your guess is too low.'

 

    if guess > number:

        print 'Your guess is too high.'

 

    if guess == number:

        break

 

if guess == number:

    print 'Good job, {0}! You guessed my number in {1} guesses!'.format(name, guesses_made)

else:

    print 'Nope. The number I was thinking of was {0}'.format(number)

 

Expert Answer

Want to see the step-by-step answer?

Check out a sample Q&A here.

Want to see this answer and more?

Experts are waiting 24/7 to provide step-by-step solutions in as fast as 30 minutes!*

*Response times may vary by subject and question complexity. Median response time is 34 minutes for paid subscribers and may be longer for promotional offers.
Tagged in
Engineering
Computer Engineering

Other

Related Computer Engineering Q&A

Find answers to questions asked by students like you.

Q: Write a class, AgeMessages , which does the following:a. Ask the user to enter age using a Scannerb....

A: The algorithm for the program would be as below:Declare one float variable for accepting user inputP...

Q: Assume the following declarations and initializations (MIN, MAX, num) are made just before each sub-...

A: 1. Program plan:Define the class.Define the “main()” function.Initialize the necessary variables.The...

Q: how to implement a KMS system at any firm where employees can use it but not depend on it

A: Ans. Knowledge management system:Knowledge management system deals with storing and managing data or...

Q: Hello, How to create a function in Python that strips the first letters from all file names in a dir...

A: The given program can be implemented using following instructions:In the function StripFirstLetter()...

Q: What values will print? Use Eclipse to verify it • Only write the answerdouble x = Math.sqrt(4);Syst...

A: Solutions://Define the classpublic class Example{     //Define the main() method     public static v...

Q: Write a class, VoteAge, which does the following:a. Ask the user to enter their age (ex. XX)b. Get t...

A: The algorithm for the program would be as below:Declare one float variable for accepting user inputP...

Q: this question is from fundamentals of logic. related to boolean algebra. I am unable to decipher the...

A: Click to see the answer

Q: Provide a functional block diagram for a concept for an autonomous transportation and/or delivery th...

A: Autonomous transportation is the evolution of transport where the vehicles are connected to create a...

Q: Write a program called StudentTable that prints the below table. Use only print() orprintf(). DO NOT...

A: The program in Java would be using print and printf statements with formatting for left alignment of...

Q: Consider the client A sends the data of 12 bytes to the sender B using the UDP. What is the efficien...

A: Efficiency:In User Datagram Protocol (UDP), the formula for computing efficiency of the transmission...

Q: Show the output of the following code: Explain brieflyint a = 6;int b = a++;System.out.println(a);Sy...

A: The Output of the given code is shown below along with the code. To run the given code, it is import...

Q: How do I write a code that places my name in an email link? Thanks

A: As there is no particular programming language mentioned, we are doing this using HTML code.

Q: Consider the UDP header 12 03 00 OF 00 1E A3 10. What is the total length of the UDP? a) 32 bytes b)...

A: Consider the given:The given User Datagram Protocol header is “12 03 00 0F 00 1E A3 10”.

Q: What is the new sematic elements in HTML5? 111 <mark iv a. i and iv b. iand iii c. i, ii and iv d....

A: Out of the given options, the semantic elements of HTML5 are&lt;details&gt;&lt;nav&gt;&lt;mark&gt;He...

Q: how can I create comments in python?

A: In python, # character is used to start the single line comments. Place a hash symbol in front of a ...

Q: Write a program in Eclipse that contains 2 methods, main and printLine.

A: Program plan: Import necessary packages.Define a class named “PrintCheck”.Define a method called “pr...

Q: this is a problem that I have how would I go about solving it? Stadium Seating There are three seati...

A: Algorithm: Include required header files.Define main function.Initializes the seat prices for class ...

Q: this is a problem that I have how would I go about solving it?Im using python so please put the answ...

A: Algorithm: Initializes the seat prices for class A, B and CDefine main function.Display message stat...

Q: Ask the user to enter the month of the year (number 1 through 12): “Enter the month of the year - nu...

A: The algorithm for the program would be as below:Declare one int variable for accepting user inputPro...

Q: Write a program called HeadsOrTails, that lets the user guess whether the flip of a coinresults in h...

A: The following variables used:coin to hold the value of random flipcoinString to hold the text value ...

Q: Consider the sender A transmits 12 data packets to B using stop wait protocol. If every 3rd packet i...

A: Analysis:In stop and wait protocol, the data packets will be transmitted as follows:1, 2, 3, 3, 4, 5...

Q: Write a program in Eclipse called LoopMethod (main method) that contains a method called printNums (...

A:  Algorithm: Step 1: Import required package.Step 2: Define “LoopMethod” class.Step 3: Define main fu...

Q: I need help with this problem I attatched the sample output Exempt You will be writing a program to ...

A: Program plan:Display the welcome statementGet the average value from the user and check the average ...

Q: Are all nonfunctional requirements equally important?  Why or why not?

A: Justification:“Yes”, All non functional requirements are equally important.

Q: 2) Identify the errors in the following programs a) 3 errorspublic class Test {public static void ma...

A: Hey, since there are multiple questions posted, we will answer first question. If you want any speci...

Q: Assume that a firm has already implemented a KMS system, as a manager, how do you ensure that learni...

A: The given case study describes the internal knowledge assets of the organization and details about t...

Q: Problem: Write a program that converts degrees from Celsius to Fahrenheit, using the formula:Degrees...

A: Since you have asked two separate questions and it was not clear which specific question you wanted ...

Q: Imagine you’d like a contractor to build a software application for you that operates like Windows C...

A: Since there are multiple questions and no specification as to which question needs to be solved, her...

Q: Don't really know how to start solving this problem.

A: Using 4 bit counter we can implement a modulo 12 synchronous counter by ensuring that all the flip f...

Q: Im using python and i need to 1)Fill the function definitions 2) Fill in the missing code in main() ...

A: Program Instructions:Use math.pi to calculate the area and circumference of the circle.Use ‘“{:,.2f}...

Q: Hello, I am trying to write a program: Write a .py file like MainFiles.py In that .py, create a func...

A: A python file is created named as MainFiles.py:Def main( ):Print(“ Welcome to python”)The above pyth...

Q: Identify the errors in the following program. 2 errorspublic class Test {public static void main(St...

A: The two errors in the given program are:The argument is passed in wrong order in the line nPrintln(5...

Q: Consider the window size is 10, bandwidth is 1500 bps, transmission delay is 2 ms and propagation de...

A: Formula for Throughput:In Go-back-N protocol, the formula for computing the throughput is given belo...

Q: The following print code is to find out the ASCII code, character for the decimal codes,and comparis...

A: Reasons for displaying given output for each line of code: For “System.out.println((int)'1');”: From...

Q: Based on Program.Py below, define and describe a soft process (using a process model), which you wil...

A: Solution:Process model:The software process contains the four activities such as software specificat...

Q: public class TestAverage {public static void main(String[] args) {int test1, test2, test3, sum;Scann...

A: The objective of the program is to calculate the average, now since the variable which holds the ave...

Q: how do you known when you need to use int and float? I know that int refers to intergers and float r...

A: “input” keyword in Python:In Python, the function which is used to read the input from the keyboard ...

Q: Which element is required in a web application to operate the Server-Sent Events? a. c. eventsource...

A: Correct answer:The correct option is “c”.Explanation:“&lt;eventsource&gt;” is the element used in a ...

Q: Based on a decision tree structure - what are three decisions that may be applicable to a project? w...

A: A decision tree is a supervised learning technique which acts as a decision support tool. It forms a...

Q: Do you think technologies like Big Data and Predictive Analytics in Marketing would have worked 10-1...

A: The technologies like Big Data would not have worked 10-15 years back as due to lack of large datase...

Q: For this program you need to use Eclipse

A: The program has the following algorithm:Declare the necessary variables within the “main()” function...

Q: Write a program in Eclipse called LoopMinMax that reads in 4 values from the user and prints the low...

A: Algorithm: The program has the following algorithm:The class name is “LoopMinMax” and in the main me...

Q: A sequential circuit has an input (X) and two outputs (S and V). X represents a 4-bit binary number ...

A: Solution:The following code is described about the behavioral Verilog description for given state gr...

Q: What is the complement of the function F X7+ (X+TZ)+7? a) (XF( Z)).Y b) (X+F Z).Y c) (+ Z))Y d) .T+Z...

A: Complement of the function:The computation of complement of the given function is provided below:

Q: Write a program to convert between KPH and MPH in either direction.If you are driving across the bor...

A: Click to see the answer

Q: Which of the following is true? I. The 80/20 rule states that 80% of the instruction is executed and...

A: 80/20 rule was first introduced by Vilfredo Pareto and therefore in also commonly known as Pareto pr...

Q: “Performance” or “response time.” defines how fast an application presents an output once given an i...

A: Performance bottleneck:It is defined as a condition in a system which can cause delays or slow down ...

Q: I need help figuring out how to summarize the content and format of a written technical report.

A: While we are writing a technical report we need to figure out the following points.The title page of...

Q: What is the output of the following code? def test_func (*a) print (a[0]) test_func1,2,3,4) test fun...

A: Consider the given code:#Function definition test_func()def test_func(*a):    #Print the output    p...

Q: How would i solve this in python i cant figure it out A wall has been built with two pieces of sheet...

A: Program plan:Initialize the length of the small sheetrock in the variable “small”.Initialize the len...