1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
cupoosta [38]
3 years ago
8

Python Question: write a program that generates a random number in the range of 1 through 100, and asks the user to guess what t

he number is. If the user’s guess is higher that the random number the program should display "too high try again." If the user’s guess is lower than the random number, the program should display "too low,try again" If the user guesses the number the application should congratulate the user and then generate a new random number so the game can start over.
This is what I have so far..

#generates and imports a random number between 1-100
import random
number=random.randint(1,100)

#sets main function
def main():
print("This is a number guessing game.")
print("Guess what number we thought of between 1 and 100")
#print statement

num = number()
#stores number of user guesses
user = 0
#stores number of guesses
guesses = 0
#while statement
while user != num:

user=int(input("Enter your best guess!"))

guesses=guesses +1

if (user > num):
print ("Too high, try again")
else:
print("Congrats, you won!")
print("Restarting game")


main()
Computers and Technology
1 answer:
natima [27]3 years ago
6 0

Answer:

import random

arr=[]

for i in range(100):

   arr.append(i)

while True:

   answer=random.choice(arr)

   guess=int(input("enter your guess number between 0-100: "))

   if answer is guess:

       print("right guess\ncongratulations.....")

       print("the answer was: "+str(answer))

       break

   elif guess < answer-20:

       print("you guessed too low....\ntry again")

       print("the answer was: "+str(answer))

   elif guess > answer+20:

       print("you guessed too high....\ntry again")

       print("the answer was: "+str(answer))

   else:

       print("incorrect guess\ntry again")

       print("the answer was: "+str(answer))

Explanation:

You might be interested in
Electronic mail is a
skad [1K]

Answer:

A) Transmission of letter, message and memos over a communication network

Explanation:

Communication can be defined as a process which typically involves the transfer of information from one person (sender) to another (recipient), through the use of semiotics, symbols and signs that are mutually understood by both parties. One of the most widely used communication channel or medium is e-mail (electronic mail).

An e-mail is an acronym for electronic mail and it is a software application or program designed to let users send texts and multimedia messages over the internet.

Hence, electronic mail is a transmission of letter, message and memos over a communication network. Some examples of the commonly used electronic mails platform are Yahoo, G-mail, etc.

5 0
3 years ago
What is copycat <br> i don't know it
Feliz [49]
A childish term for someone who copies others 
8 0
4 years ago
Read 2 more answers
Security is a major concern with m-commerce. How can m-commerce software ensure the security of transmissions and that the trans
dimaraw [331]

Answer:

Security in communication between applications and sites in m-commerce can use SSL technology.

Explanation:

While developing an app, developers have to perform several checks and ensure that the server has a legitimate certificate.

7 0
2 years ago
Anomaly detection systems make use of _______________ that describe the services and resources each authorized user or group nor
zhuklara [117]

Answer:

profiles

Explanation:

<h2><u>Fill in the blanks </u></h2>

Anomaly detection systems make use of <u> profiles</u> that describe the services and resources each authorized user or group normally accesses on the network.

5 0
3 years ago
Is www part of every url address?
melisa1 [442]
The correct answer is that WWW. is universal, meaning that any and all url addresses start and have www.

My reasoning is that if you were to look up, lets say google, do :

www.(google).com ( remove parentheses )

then

google.com 

You come up with the same results THUS YOUR CORRECT ANSWER IS YES! ALL URL ADDRESS HAVE AND CONTAIN WWW.!!!

5 0
4 years ago
Other questions:
  • Which function of a web page relies on responsive web design? Adding extra horizontal scroll Blocking mobile devices from viewin
    11·2 answers
  • If you find yourself in a position where you need to restore an object or container within active directory that has been inadve
    6·1 answer
  • Online retailer Amazon relies heavily on a hierarchy culture to manage its vast and complex shipping processes. ___________ are
    11·1 answer
  • Inthe old days, databases did NOT support ____________.
    10·1 answer
  • Which os the following is NOT true about the proof of work concept?
    8·1 answer
  • Linux is a kind of software whose code is provided for use, modification, and redistribution. what kind of software is this?
    5·1 answer
  • Write a java program to input the corresponding data to print the result of the following expression
    9·1 answer
  • Explain how principles of computer programming are applied in different languages to produce
    5·1 answer
  • Hey guys,i have a question. 2x + 7x + 1y.how do i simplify it
    11·1 answer
  • If an algorithm created to help make hiring decisions is based on previous unfair decisions, then the algorithm may be
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!