Create a python program? https://liucs.net/cs101f19/assignment-05.html

Np Ms Office 365/Excel 2016 I Ntermed
1st Edition
ISBN:9781337508841
Author:Carey
Publisher:Carey
Chapter6: Managing Multiple Worksheets And Workbooks
Section: Chapter Questions
Problem 4.12CP
icon
Related questions
Question

Create a python program? https://liucs.net/cs101f19/assignment-05.html

Expert Solution
Code:

# Name- MyName
# Date- 19/11/2020
# Description- Number guessing game

import random

print("Welcome to the guessing game.")

name = input("What is your name? ")

print("I'm thinking of a number between 1 and 100.")
secretNumber = random.randrange(1,101)

count = 0

while True:
    userGuessed = int(input("Your guess? "))
    count = count + 1

    if userGuessed > secretNumber:
        print("Too high!")
    elif userGuessed < secretNumber:
        print("Too low!")
    else:
        break

print("Yes, my secret number was", secretNumber)
print("Congratulations,", name ,"you got it in", count ,"guesses")

trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Top down approach design
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,