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

  Write a python program to implement the diff command

Without using the system() function to call any bash commands, write a python program that will implement a simple version of the diff command.

  Write a program for checking a circle

Write a program for checking a circle program must either print "is a circle: YES" or "is a circle: NO", appropriately.

  Prepare a python program

Prepare a Python program which evaluates how many stuck numbers there are in a range of integers. The range will be input as two command-line arguments.

  Python atm program to enter account number

Write a simple Python ATM program. Ask user to enter their account number, and print their initail balance. (Just make one up). Ask them if they wish to make deposit or withdrawal.

  Python function to calculate two roots

Write a Python function main() to calculate two roots. You must input a,b and c from keyboard, and then print two roots. Suppose the discriminant D= b2-4ac is positive.

  Design program that asks user to enter amount in python

IN Python Design a program that asks the user to enter the amount that he or she has budget in a month. A loop should then prompt the user to enter his or her expenses for the month.

  Write python program which imports three dictionaries

Write a Python program called hours.py which imports three dictionaries, and uses the data in them to calculate how many hours each person has spent in the lab.

  Write python program to create factors of numbers

Write down a python program which takes two numbers and creates the factors of both numbers and displays the greatest common factor.

  Email spam filter

Analyze the emails and predict whether the mail is a spam or not a spam - Create a training file and copy the text of several mails and spams in to it And create a test set identical to the training set but with different examples.

  Improve the readability and structural design of the code

Improve the readability and structural design of the code by improving the function names, variables, and loops, as well as whitespace. Move functions close to related functions or blocks of code related to your organised code.

  Create a simple and responsive gui

Please use primarily PHP or Python to solve the exercise and create a simple and responsive GUI, using HTML, CSS and JavaScript.Do not use a database.

  The program is to print the time

The program is to print the time in seconds that the iterative version takes, the time in seconds that the recursive version takes, and the difference between the times.

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