Find a random number import random - you are responsible


# 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()

Request for Solution File

Ask an Expert for Answer!!
Python Programming: Find a random number import random - you are responsible
Reference No:- TGS02273915

Expected delivery within 24 Hours