4-3 Assignment

.docx

School

Southern New Hampshire University *

*We aren’t endorsed by this school

Course

140

Subject

Computer Science

Date

Jan 9, 2024

Type

docx

Pages

2

Uploaded by AmbassadorDolphinPerson1004

Report
4-3 Assignment: Pseudocode Revisited import random seedVal = int(input("What seed should be used? ")) random.seed(seedVal) while True: lower = int(input("What is the lower bound?")) upper = int(input("What is the upper bound?")) if lower > upper: print("Lower bound must be less than upper bound.") else: break random_num = random.randint(lower, upper) while True: user_input = int(input("What is your guess?")) if user_input < lower or user_input > upper: print("please guess number in limit ") elif user_input == random_num: print("You got it!")
break elif user_input > random_num: print("Nope, too high.") elif user_input < random_num: print("Nope, too low.")
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help