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
natulia [17]
3 years ago
6

Given the code that reads a list of integers, complete the number_guess() function, which should choose a random number between

1 and 100 by calling random.randint() and then output if the guessed number is too low, too high, or correct. Import the random module to use the random.seed() and random.randint() functions. random.seed(seed_value) seeds the random number generator using the given seed_value. random.randint(a, b) returns a random number between a and b (inclusive). For testing purposes, use the seed value 900, which will cause the computer to choose the same random number every time the program runs. Ex: If the input is:
Computers and Technology
1 answer:
Cerrena [4.2K]3 years ago
5 0

Answer:

see explaination

Explanation:

import random

def number_guess(num):

n = random.randint(1, 100)

if num < n:

print(num, "is too low. Random number was " + str(n) + ".")

elif num > n:

print(num, "is too high. Random number was " + str(n) + ".")

else:

print(num, "is correct!")

if __name__ == '__main__':

# Use the seed 900 to get the same pseudo random numbers every time

random.seed(900)

# Convert the string tokens into integers

user_input = input()

tokens = user_input.split()

for token in tokens:

num = int(token)

number_guess(num)

You might be interested in
White meat and dark meat fish have slightly different nutritional characteristics. What are the nutrition characteristics of dar
Marina CMI [18]

The nutrition characteristics of eating darker meat of fish like Salmon are that it is higher in healthy Omega-3 fats. It is true, however, that as much as it has the highest Omega-3 fats, it is also likely to be highest in any potential toxins.






7 0
3 years ago
Read 2 more answers
1.-  POR QUE LOS HUMANOS NOS INTERESAMOS EN ROBOTS CONASPECTO HUMANO?
oksian1 [2.3K]

Answer:

........

Explanation:

s

6 0
3 years ago
What type of computer is likely to use so-dimms, have an internal power supply, and use a desktop processor socket?
Gekata [30.6K]
Obviously, it is a laptop. So-Dimms are about half as long as Dimms, and are meant for laptops.
8 0
3 years ago
Local variables:A. Lose the values stored in them between calls to the method in which the variable is declared
Serjik [45]

Answer:

All of the above

Explanation:

A local variable is a variable which is declared within a method or is an argument passed to a method, it scope is usually local (i.e. it is hidden from other method). it can also have the same name as a local variable in another method and it loses the values stored in them between calls to the method in which the variable is declared. So all the option listed above are correct.  

3 0
3 years ago
For each of the following SQL queries, for each relation involved,list the attributes that must be examined to compute the answe
Vlada [557]

Answer:

1. E.eid ,E.hobby, E.sal, E.did

2.E.eid , E.sal, E.hobby ,E.did , D.did, D.floor ,D.dname , D.budget.

3.E.eid , E.sal, E.hobby ,E.did , D.did, D.floor ,D.dname , D.budget.

4.E.eid , D.dname

Explanation:

The attributes that are examined for the query are the attributes of the table that are mentioned in the select statement and where clause.

So according to first query we are working on all attribues of Emp table so all of the attributes of Emp table are examined.In second query we selecting all attributes of both the tables hence all attributes of both the table and same in the next query.

In fourth query though the query is not complete where clause is missing but we have eid from Emp and dname from Dept tables for sure and the attributes mentioned in where clause will also be present.

7 0
3 years ago
Other questions:
  • True are fulse A piece of information that is considered common knowledge does not need a citation
    5·2 answers
  • Dit View
    5·2 answers
  • What is the best temperature to set your air conditioner on?
    12·1 answer
  • Queremos conectar una pila de 4,5 V a un diodo LED cuya tensión de trabajo es de 2 V. Calcula cuál debe ser el valor de la resis
    8·1 answer
  • Whats the most popular social networking in the philippines?
    10·1 answer
  • Select the examples of common Arts, A/V Technology, and Communication employers. Check all that apply.
    10·2 answers
  • Write an algorithm for finding the perimeter of a rectangle
    6·1 answer
  • How do you remove management from your chrome book [administrator]
    12·1 answer
  • Can someone pls do a toradora,Mha or princess jellyfish rp I'm open for anyother rp's
    11·2 answers
  • Non related to school but im interested,<br><br> Who here actually watches dream smp be honest
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!