Write a file that plays a simple guessing game with you

Assignment Help Python Programming
Reference no: EM132356735

Question

Write a file named higher_lower.py that plays a simple guessing game with you.

The computer will pick a number between 1 and 100, then give you a given number of guesses. If you guess right, it will say You win!. If you guess higher or lower than correct, it will say The number is higher than that. (or lower). If after the given number of guesses they still don't know the number, print You lose; the number was x. where x was the number you were to guess.

Before the game begins,

Ask what number to pick. If they say -1, pick randomly; otherwise, use their number even if it is outside the 1-100 range. See lab 6 for a review of how to get a random integer by using the random.randrange() method.

Ask how many guesses they should have. You may assume they respond with a positive integer.

Reference no: EM132356735

Questions Cloud

Demonstrate the application of theory to workplace : Reflect on the connection between knowledge or concepts from these courses and how those have been, or could be, applied in the work place (200-250 words per).
Generate the total number of occurrences for each side : You roll the dice 10,000 times. Each time you get one of six sides with a probability of 1/6. You need to generate the total number of occurrences.
Applied in particular field of study or work environment : How can the results and conclusions presented in this study be applied in your particular field of study or work environment?
Explain the innovation and technologies policy issues : Write a research paper that explains the innovation and technologies policy issues and its impacts on people in a global environment.
Write a file that plays a simple guessing game with you : Write a file that plays a simple guessing game with you. The computer will pick a number between 1 and 100, then give you a given number of guesses.
Determining the competitive value of information technology : Please respond to the following: Identify three factors to consider in determining the competitive value of information technology. Justify the selected factor.
How social media provides a competitive advantage : Analyze how social media provides a competitive advantage for an organization's Web strategy, given that many companies have started hiring personnel to handle.
Assess expected cost savings in hardware infrastructure : Support the need for the use of cloud technology and virtualization within the company. Assess expected cost savings in hardware infrastructure.
How many times does the body of the while loop repeat : How many times does the body of the while loop repeat? What is the output of each loop? Write a program which gives the option between doing 3 things.

Reviews

Write a Review

Python Programming Questions & Answers

  Create an an expression that produces a list of all values

Create an an expression that produces a list of all the values from 1 to n, which are not divisible by 2 or divisible by 3.

  Define different functions for the conversions

Define different functions for the conversions. Call these functions within the while loop. Use docstrings for your comments.

  Write a non-fruitful function drawequitriangle

Write a non-fruitful function drawEquitriangle(someturtle, somesize) which calls drawPoly from the previous question to have its turtle draw a equilateral triangle

  1 why is biodiversity importantnbsp discuss the ways in

1 why is biodiversity important?nbsp discuss the ways in which the value may be assigned to biodiversity. based on your

  Compute and display the charges for a patients hospital stay

Write a program that computes and displays the charges for a patient's hospital stay. First, the program should ask patient name and if the patient was admitted

  Program for simulating a supermarket self-service

Design and model two classes: Product and CheckoutRegister - Create an activity chart which describes the behaviour of the checkout system

  Review the functional requirements section

Review the Functional Requirements section and make sure you hit all the points. This will not guarantee a perfect score, however

  How does the given change your programming capabilities

CS 192- Considering the lessons on menu logic and the use of arrays and loops, how does this change your programming capabilities? What kind of programs can you now create utilizing these powerful programming tools?

  Define function that convert number value to character digit

COP 1500 Intro Computer Science Number Systems Project Assignment - Then define a function that can convert a number value to a character digit

  Apply struct for reading packet data

Topic: Python 3 - PCAP file analysis - Apply struct for reading packet's data, extract and hash the ICMP data portion of the packet

  Prompt the user to enter the amount of a dinner bill

A common issue with dinning out is calculating the correct tip amount. Need a Python program that will Prompt the user to enter the amount of a dinner bill.

  Explain what python ides are being used in the industry

Explain what Python IDEs are being used in the industry? Compare/contrast features (chart might be helpful). Research differences between JES, IDLE and PyCharm.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd