Find a random number import random

Assignment Help Python Programming
Reference no: EM131478349

# Copy this file into IDLE.

# Name this file homeworkl0.py and submit it to Canvas after completing the program

# according to the directions above each function

# This import statement is how we get the random function, to find a random number import random

def main() :
guessNumber()
twoInts()

# Copy and paste this program into IDLE. Part of this program is written for you, but
# you are responsible for completing the program by adding the proper while loop

# The program should do the following:
# Gets a random number betweek 1 and 50 and prompts the user to guess it in as few attempts
# as possible.
# This function should use a while loop
# Pseudo Code for the while loop:
# while the guessed number does not equal the number to guess
# fetch the guessed number
# convert the guessed number from a string to an integer

# if the guessed number equals the number to guess
# print to the screen "You got it!"
# otherwise if the guessed number is less than the number to guess
# print "Higher"
# otherwise if the guessed number is greater than the number to guess
# print "Lower"

def guessNumber()

# The randint() function returns a random number between the first and second parameters
numberToGuess = random.randint(1, 50)
print("I'm thinking of a number between 1 and 50...")
print("Enter a guess:")
guessedNumber = 0
# while loop that you write goes here

# The twoInts() function will contain python code that does the following:
# Read two integers numl and num2 from the user
# Print a message indicating which of the two integers is the smallest
# and largest.
# Print the integers between numl and num2 in increasing order

def twoInts() :
main()

Reference no: EM131478349

Questions Cloud

Discuss how this will change the reporting of risks : Practitioners have used and disclosed VaR since the 1990s. The Basel Committee on Banking Supervision has proposed replacing VaR with a different one-sided.
Critical to the success of an intervention : Why is the role of manager critical to the success of an intervention?
Organizational change and workforce management : Memorial Hospital System (MHS) has been facing many serious issues, including leadership problems, staffing deficiencies, and financial hardship.
Watch the film-the lost children of rockdale county : Why high emotionally intelligent kids are less likely to abuse drugs and the diferrence between low EI and high EI.
Find a random number import random : Find a random number import random - you are responsible for completing the program by adding the proper
Discuss the effect of lower assumed discount rate on pension : Before January 1, 2005, Norwegian Telenor ASA prepared its financial statements according to Norwegian Generally Accepted Accounting Principles (N GAAP).
Discuss the groups philosophy and techniques of operation : Discuss the group's philosophy and techniques of operation. Discuss the biblical foundations for the group's purpose and activities.
Write about the difference between the human rights : Write about the difference between the human rights, in China which is caused by Confucius idea, write about the impact on the relationship.
Explain the agencys approach to training and programs : Evaluate the agency's approach to training and programs provided for new and existing employees for the development of knowledge.

Reviews

Write a Review

Python Programming Questions & Answers

  What are the issues assciated with top-down analysis

what are the issues assciated with top-down analysis please explain?

  Write a program to receive a series of numbers

Write a program to receive a series of numbers (including decimal) from the user until enter key is pressed. Process the input data and display number count, sum and average. Use proper data type and format.

  How many cents for each paper

Using Tkinter for cents Program, find the How many cents for each Paper

  Project - movie lovers club

The Movie Lovers Club is a club of persons that love to watch movies and keep track of how many times they have watched the movies they love.

  Design and implement mini-missions in the haunted house

Create a cheat commands in the game so player can pick up any item he wants from any location in the map. You have to name this cheat command 'giveme'

  Programmer does not have to use the def statement

Unlike Z+-, the programmer does not have to use the DEF statement to create a variable. Instead, the programmer can simply use the variable. The first use of the variable creates it and initializes it to 0.

  Write a short program in python that turns on all leds

Write a short program in Python that turns on all LEDs, one at a time, in a looping fashion. When an LED is on, it should stay on for 1 second.

  Modify your code to ask the user for the id of a restaurant

Copy check1.py to check2.py and continue to work on check2.py. Modify your code to ask the user for the id of a restaurant between 1 and 155 (humans don't need to know about list ids starting at 0).

  Write program that read a text file and prints only odd line

Write a program that reads a text file and prints out only odd lines to the screen. Thus, lines 1, 3, 5,... only printed. Update your odd lines program (Q1) to write odd lines to the screen and write then lines to another file.

  Write a program that will input the name of five students

Write clearly with documentations where necessary as you write the program to solve the following problem.

  Let ll be a list of integers

Let LL be a list of integers. Use list comprehension to produce teh following lists. Each one should just take onel line. Anser questions as two comments.

  Write python code that will execute a list

Write python code that will execute a list of functions with supplied parameters and report the observed runtime for each function run. Assume that the input file has a list of strings like so:

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