Write a program named guess_number.py. Use NumPy to generate a random number between 1 and 100. Accept int input and ask user to guess number. Inform if high or low. Exit when entered number correct. Tell user how many tries it took to guess number.

Answers

Answer 1

Answer:

download the .txt file and change the file name to guess_number.py then run it in a python interpreter. I used Python 3.9.6 for this project and I used Visual Studio Code as my IDE.

Explanation:

The code has comments that tell you what is happening.

I hope this helped :) If it didn't please let me know what went wrong so I can fix it.

Answer 2

In a program named guess_number.py. Use NumPy to generate a random number between 1 and 100. Accept int input and ask the user to guess the number.

What are programming used for?

The motive of programming is to discover a series of commands with the intention to automate the overall performance of a task (which may be as complicated as a running system) on a computer, regularly for fixing a given problem.

Import NumPy as np def main(): # Random variety Random Number = np.random.randint(1, 100) # A begin variable Start = Try.# This value is the handiest used to decide if the person has been known that the fee is excessive or low   High Or Low Message Displayed Already = False # Amount of guesses that the person were given incorrectly. Guess Gotten Wrong 0 # The general quantity of guess AmountOfGuesses = 0 # Beginning of some time loop in order to maintain the software jogging till the person guesses the random variety print("The fee is excessive") High Or Low Message DisplayedAlready = True Elif RandomNumber <= forty nine and High OrLow MessageDisplayedAlready == False:

           print("The fee is low")

           High Or Low Message Displayed Already = True.

AmountOfGuesses += print("Wrong! You have gotten " + str(GuessGottenWrong) + " guesses incorrect. main()

Read more about the program :

https://brainly.com/question/1538272

#SPJ2


Related Questions

Prime numbers can be generated by an algorithm known as the Sieve of Eratosthenes. The algorithm for this procedure is presented here. Write a program called primes.js that implements this algorithm. Have the program find and display all the prime numbers up to n = 150

Answers

Answer:

Explanation:

The following code is written in Javascript and is a function called primes that takes in a single parameter as an int variable named n. An array is created and looped through checking which one is prime. If So it, changes the value to true, otherwise it changes it to false. Then it creates another array that loops through the boolArray and grabs the actual numberical value of all the prime numbers. A test case for n=150 is created and the output can be seen in the image below highlighted in red.

function primes(n) {

   //Boolean Array to check which numbers from 1 to n are prime

   const boolArr = new Array(n + 1);

   boolArr.fill(true);

   boolArr[0] = boolArr[1] = false;

   for (let i = 2; i <= Math.sqrt(n); i++) {

      for (let j = 2; i * j <= n; j++) {

          boolArr[i * j] = false;

      }

   }

   //New Array for Only the Prime Numbers

   const primeNums = new Array();

  for (let x = 0; x <= boolArr.length; x++) {

       if (boolArr[x] === true) {

           primeNums.push(x);

       }

  }

  return primeNums;

}

alert(primes(150));

Explain how you would find a book on a given subject in the library.

Answers

Answer:

In case I am looking for a specific book in a library, the way in which I would try to find it would be through consulting the library guide, or through inspection of the different books of the specific sector with which the book I'm looking for is listed, or by asking the library staff to help me with my search.

Write a demo test to verify the above Rectangle object accessible from demo test main program and can execute display() method to output.

Answers

Answer:

Explanation:

The Rectangle class was not provided in this question but after a quick online search I was able to find the class code. Due to this I was able to create a test code in the main Method of my program to create a Rectangle object and call it's display() method. The Test code and the output can be seen in the attached image below. While the code below is simply the Main Test Program as requested.

class Brainly {  

   public static void main(String[] args) {

       Rectangle rectangle = new Rectangle(20, 8);

       rectangle.display();

   }

}

Select the correct answer.
Which of these statements is true of dynamic design diagrams?
A.
They demonstrate objects.
B.
They demonstrate relationships.
C.
They demonstrate the behavior of system aspects.
D.
They include structure diagrams.

Answers

Answer:

They demonstrate the behavior of system aspects.

The statement true regarding the dynamic design diagram is that it demonstrates the behavior change in the system. Thus, option C is correct.

What is a dynamic design diagrams?

A dynamic design diagram is given as the model that has been expressing the development of the operations, actions, and the behavior of the system over time.

The dynamic design diagram is thereby the demonstration of the behavior of system aspects. Thus, option C is correct.

Learn more about dynamic design, here:

https://brainly.com/question/14956129

#SPJ2

A technician is setting up a VM for use in testing software deployments. The VM is offline, but the hypervisor is not. Which of the following settings should the technician change to resolve this issue

Answers

Answer:

The answer might be C.

Explanation:

Virtualization software (hyper-v, vm ware, virtual box) has a power button to power on the virtual machine, so in the real world you would press the power button. But the virtual CPU is the closet thing to a power button.

the right answer might be c

1. You purchase a new desktop computer that does not have wireless capability, and then you decide thar you want to use a wireless connection to the internet. Give two solutions to upgrade your system to wireless.
2. You are replacing a processor on an older motherboard and see that the board has the LGA1155 socket. You have three processors on hand: Intel Core i3-2100, Intel Core i5-8400, and Intel Core i5-6500. Which of these three processors will most likely fit the board? Why?a. 4.b. 5.c. 6.d. 7.

Answers

Answer:   1.)  You can use a USB WiFi adapter, install a dedicated PCIe WiFi card, or upgrade to a new motherboard with built-in WiFi. (That's three solutions but just want to give you flexibility with your problem.)

Answer:    2.)  None of the processors would fit because they all have different series sockets. (The i5 processors have LGA1151 sockets and the i3 has an LGA1156 socket.)

Explanation: 1.)  Usb WiFi adapter, dedicated PCIe WiFi card, OR a new motherboard with built-in WiFi

                     2.)  None of the processors work

Virtualization:

a. can boost server utilization rates to 70% or higher.
b. has enabled microprocessor manufacturers to reduce the size of transistors to the width of an atom.
c. uses the principles of quantum physics to represent data.
d. allows smartphones to run full-fledged operating systems.
e. allows one operating system to manage several physical machines.

Answers

The answer: A

If you would like to understand more on this, I have found an excellent quizlet.
Search this up: Using IS for Bus. Problems chp.5 practice quiz

Which support function under Tech Mahindra is governing data privacy and protection related requirements

Answers

Answer:

Privacy Policy

Explanation:

PRIVACY POLICY is the support function under Tech Mahindra that is governing data privacy and protection-related requirements.

Given that support functions are functions which assist and in a way contribute to the company goal.

Other support functions are human resources, training and development, salaries, IT, auditing, marketing, legal, accounting/credit control, and communications.

The above statement is based on the fact that the Privacy Policy clarifies all the data protection rights, such as the right to object to some of the production processes that TechM may carry out.

You work as the IT Administrator for a small corporate network you need to configure configure the laptop computer in the Lobby to use the corporate proxy server. The proxy server is used to control access to the internet. In this lab, your task is to configure the proxy server settings as follows: Port: 9000

Answers

Answer:

okay if I am it administration I will port 10000

To configure the computer in the lobby to use the corporate proxy server, you will need to follow these steps:

Settings > Networks&Internet > Proxy > Manual Proxy Setup > Address & proxy > save

What is Proxy Server?

A proxy server is a device or router that acts as a connection point between users and the internet.

Proxy Server settings would be the same for both Wifi and Ethernet connections, explaining about the configuration in Windows Operating System.

Open the internet browser on the laptop and go to the settings or preferences page. The exact location of the proxy settings will vary depending on the browser you are using.

In the settings or preferences page, look for the "Proxy" or "Network" section.

In the proxy settings, select the option to use a proxy server.

Enter the address of the corporate proxy server in the "Server" or "Address" field.

Enter the port number "9000" in the "Port" field.

Save the changes and close the settings or preferences page.

Test the proxy server configuration by attempting to access a website. If the configuration is correct, the laptop should be able to access the internet through the proxy server.

Settings > Networks&Internet > Proxy > Manual Proxy Setup > Address & proxy > save

To learn more about the Proxy Server settings click here:

https://brainly.com/question/14403686

#SPJ12

Prepare an algorithm and draw a corresponding flowchart to compute the sum
and product of all prime numbers between 1 and 50.

Answers

Answer:

Explanation:

Given

A backbone network is Group of answer choices a high speed central network that connects other networks in a distance spanning up to several miles. a group of personal computers or terminals located in the same general area and connected by a common cable (communication circuit) so they can exchange information. a network spanning a geographical area that usually encompasses a city or county area (3 to 30 miles). a network spanning a large geographical area (up to thousands of miles). a network spanning exactly 200 miles with common carrier circuits.

Answers

Answer:

a high speed central network that connects other networks in a distance spanning up to several miles.

Explanation:

A backbone network functions just like the human backbone providing support for network systems by offering a network infrastructure that allows small, high speed internet connectivity. It is a principal data route between large interconnected networks which offers connection services spanning several miles. Most local area networks are able to connect to the backbone network as it is the largest data connection on the internet. This backbone networks are mainly utilized by large organizations requiring high bandwidth connection.

a which is the smallest chunk of information of computer can work with​

Answers

Answer:

I still mad for that spam

Explanation:

Answer:

The bits are the smallest chunk of info that is used by computers.

Explanation:

Bit: A short abbreviation for binary digit which is the smallest unit of data.

You're welcome.

I hope I helped you.

The development of the modern computer system has been evolutionary. Discuss this phenomenon and further discuss how current trends in computing would impact future computer systems development

Answers

Answer:

The modern computer system has been evolutionary. Modern computers have allowed for us to complete hard tasks rather easily. With modern computers, we are able to calculate advanced equations with the click of a button. Trends in computing like RTX can rapidly improve performance, rendering, and tons of other graphical heavy actions. In September of 2018, we got the first RTX card, now in 2021, RTX has become exponentially better than what it was in 2018. With the modern computers comes quantum computers. Quantum computing is estimated to be 100 million times faster than any modern computer. IBM, the company to make the first computer stated that we are in the decade of quantum computing. And who knows? Maybe quantum computing will come sooner rather than later.

Explanation:

You probably should modify this a little so you don't get in trouble. I researched each topic I put into this for about an hour so I hope this is what you need. If it isn't, please don't hesitate to tell me what I didn't add or what went wrong.

Have a good day :)

If i took my SIM card out of my phone and put it in a router then connect the router and my phone with Ethernet cable would the ping change?

Answers

Answer:

The ping will change.

Explanation:

Assuming you mean ping from device with SIM card to another host (no mater what host), the ping will change. Ping changes even on the same device because network speed and performance of all the nodes on the route changes continuously. However, if two of your devices (phone & router) are configured differently (use different routing under the hood), then it will also affect the ping.

hãy giúp tôi giảiiii​

Answers

Answer:

fiikslid wugx uesbuluss wuz euzsbwzube

What happens when a dataset includes records with missing data?

Answers

Answer:

However, if the dataset is relatively small, every data point counts. In these situations, a missing data point means loss of valuable information. In any case, generally missing data creates imbalanced observations, cause biased estimates, and in extreme cases, can even lead to invalid conclusions.

It makes data analysis to be more ambiguous and more difficult.

Missing data is simply the same as saying that there are values and information that are unavailable. This could be due to missing files or unavailable information.

A dataset set with missing data means more work for the analyst. There needs to be a transformation in those fields before the dataset can be used.

Generally speaking missing data could lead to bias in the estimation of data.

A data scientist is a data expert who is in charge of data. He performs the job of data extraction, data analysis, data transformation.

read more at https://brainly.com/question/17578521?referrer=searchResults

In MS_Excel , assume you have data base of employees with their ages,How you could checked the employee is continuous in work or not depending on his age? A) By using AND function. B) By using IF function. C) By using OR function. D) By using IF and AND functions

Answers

Answer:

C) By using OR function

Explanation:

Given

Employees database

Required

Check for employees that are continuous in work or not depending on age

The solution to this question lies in the question itself.

From the question, we are to check for

....employees that are continuous in work or not depending on age

Notice that the question does not imply the usage of an if-function but, the usage of an or function as indicated by the text in bold.

So.

If an employee is continuous in work, the function will return true

If an employee does not depend on age limit, the function will return true

The function will return false, if both conditions are not true

a. Daily Life Magazine wants an analysis of the demographic characteristics of its readers. The marketing department has collected reader survey records containing the age, gender, marital status, and annual income of readers. Design an application that allows a user to enter reader data and, when data entry is complete, produces a count of readers by age groups as follows: younger than 20, 20-29, 30-39, 40-49, and 50 and older. b. Modify the Daily Life Magazine program so that it produces a count of readers by gender within age group-that is, under-20 females, under-20 males, and so on. c. Modify the Daily Life Magazine program so that it produces a count of readers by income groups as follows: under $30,000, $30,000-$49,999, $50,000-$69,999, and $70,000 and up.

Answers

Answer:

uh

Explanation:

Discuss at least five ways of practicing good device care and placement

Answers

Answer:

The points according to the given question are provided below.

Explanation:

Batteries are quite a highly crucial part of EVs and should be handled accordingly.Whenever a part becomes obsolete, it should have been substituted every year using an innovative version.Before using an electric car, it should have been fully charged and ready to go.Within a certain duration of time, the gadget needs to be serviced again.Be sure to keep your mobile device or another gadget in such a secure location.

Write a program that asks the user to enter 5 test scores. The program will display a letter grade for each test score and an average grade for the test scores entered. Three functions are needed for this program.

Answers

Answer:

The program in C++ is as follows:

#include <iostream>

using namespace std;

double average(double s1, double s2, double s3, double s4, double s5){

   double avg = (s1 + s2 + s3 + s4 + s5)/5;

   return avg;}

char lGrade(double score){

   char grade;

   if(score>= 90 && score <= 100){ grade ='A'; }

   else if(score>= 80 && score <= 89){ grade ='B'; }

   else if(score>= 70 && score <= 79){ grade ='C'; }

   else if(score>= 60 && score <= 69){ grade ='D'; }

   else if(score < 60){ grade ='F'; }

   return grade;}

int main(){

   double s1,s2,s3,s4,s5;

   cin>>s1>>s2>>s3>>s4>>s5;

   double avg = average(s1,s2,s3,s4,s5);

   cout<<s1<<" "<<lGrade(s1)<<endl;

   cout<<s2<<" "<<lGrade(s2)<<endl;

   cout<<s3<<" "<<lGrade(s3)<<endl;

   cout<<s4<<" "<<lGrade(s4)<<endl;

   cout<<s5<<" "<<lGrade(s5)<<endl;

   cout<<avg<<" "<<lGrade(avg)<<endl;

   return 0;}

Explanation:

The three functions to include in the program are not stated; so, I used the following functions in the program

1. The main function

2. average function

3. Letter grade function

The average function begins here

double average(double s1, double s2, double s3, double s4, double s5){

This calculates the average

   double avg = (s1 + s2 + s3 + s4 + s5)/5;

This returns the calculated average

   return avg;}

The letter grade function begins here

char lGrade(double score){

This declares the grade

   char grade;

If score is between 90 and 100 (inclusive), grade is A

   if(score>= 90 && score <= 100){ grade ='A'; }

If score is between 00 and 89 (inclusive), grade is B

   else if(score>= 80 && score <= 89){ grade ='B'; }

If score is between 70 and 79 (inclusive), grade is C

   else if(score>= 70 && score <= 79){ grade ='C'; }

If score is between 60 and 69 (inclusive), grade is D

   else if(score>= 60 && score <= 69){ grade ='D'; }

If score is less than 60, grade is F

   else if(score < 60){ grade ='F'; }

This returns the calculated grade

   return grade;}

The main begins here

int main(){

This declares the 5 scores

   double s1,s2,s3,s4,s5;

This gets input for the 5 scores

   cin>>s1>>s2>>s3>>s4>>s5;

This calls the average function for average

   double avg = average(s1,s2,s3,s4,s5);

This calls the letter grade function for the 5 scores

   cout<<s1<<" "<<lGrade(s1)<<endl;

   cout<<s2<<" "<<lGrade(s2)<<endl;

   cout<<s3<<" "<<lGrade(s3)<<endl;

   cout<<s4<<" "<<lGrade(s4)<<endl;

   cout<<s5<<" "<<lGrade(s5)<<endl;

This calls the average function for the average

   cout<<avg<<" "<<lGrade(avg)<<endl;

Write a line of code to create a constant called MAX that will hold the size of an array that can store up to 25 decimal values. Separate each item with 1 space, and end the line with a semi-colon.

Answers

Answer:

A line of code to create a constant called MAX that will hold the size of an array that can store up to 25 decimal values. Separate each item with 1 space, and end the line with a semi-colon.

Here,

const int MAX = 25;

what is operating system?

Answers

Answer:

operating system (os)is translator between the operator (user)and the computer

Operating system (OS) is the low-level software that supports a computer's basic functions, such as scheduling tasks and controlling peripherals.

Predictive Algorithms Identify one use/application in which tprediction might cause significant ethical harms.

a. True
b. False

Answers

I do believe this would be true.

Your organization network diagram is shown in the figure below. Your company has the class C address range of 199.11.33.0. You need to subnet the address into three subnets and make the best use of the available address space. Which of the following represents the addressing scheme you would apply to the New York office and Toronto Office?
(A) 199.11.33.160/31
(B) 199.11.33.0/25
(C) 199.11.33.128/27
(D) 199.11.33.0/31
(E) 199.11.33.160/30
(F) 199.11.33.128/28

Answers

Answer:

aaaa

Explanation:

Suppose a company A decides to set up a cloud to deliver Software as a Service to its clients through a remote location. Answer the following [3] a) What are the security risks for which a customer needs to be careful about? b) What kind of infrastructural set up will be required to set up a cloud? c) What sort of billing model will such customers have?

Answers

Answer:

perdonnosee

Explanation:

Brandon has configured one of the applications hosted on his cloud service provider to increase the number of resources as needed. Which of the following describes this capability?

a. Continuity
b. Adaptability
c. Vertical scaling
d. Horizontal scaling

Answers

Answer:

The description of this capability is:

d. Horizontal scaling

Explanation:

The capability that Brandon has achieved is horizontal scaling, which involves the increasing of the resources of cloud applications to meet his increasing demand for cloud services.  Vertical scaling involves the addition or subtraction of power to a cloud server, which practically upgrades the memory, storage, or processing power.  But to scale horizontally, more resources are added or subtracted.  The purpose of horizontal scaling is to spread out or in the workload of existing resources and either increase or decrease overall performance and capacity.

Suppose you have some List of S List of Strings called List and a String prefix. Write a method that removes all the Strings from list that begin with prefix. public void removePrefixStrings(List-String- list, String prefix) 7. What is the time complexity of this algorithm?

Answers

Answer:

public void removePrefixStrings(List<String> list , String prefix) {

if(list==null || list.size()==0)

return;

for(int i=0; i<list.size();) {

if(list.get(i).startsWith(prefix))

list.remove(i);

else

++i;  

}  

}  

Time Complexity: If the prefix is the same as String length, Then finding all prefix match will take n *n = n2

Then removal is also n  

So the total time complexity is O(n3)

Leo is planning the new backup strategy for a subsidiary his company is purchasing that does not currently have a backup strategy in place. He decides that a full backup should be run once per week. Once per day, everything that has changed since the last full backup will be archived. Once per hour everything that has changed since the last backup of any type will be backed up. Which of the following describes the backups that will be run every hour?

a. Differential
b. Variable
c. Incremental
d. Flexible

Answers

Answer:

C. Incremental backup

Explanation:

An incremental backup is a type of backup where the succeeding copies of the data is made up of only those positions that have changed since the previous or prior copies were made. Such backups are desired since they limit the usage of space for storage and these types of back ups are faster to do that the differential backup.

When we bring this explanation to this question, we can easily see that the backup that is being carried out is done on everything that has changed since the last backup (previous backup). Therefore this is an incremental backup.

CC stand for.....in the email platform?

Answers

CC stands for Carbon Copy in emails.

Along with the "To" field of an email, you will usually have a place to enter email addresses in a CC field. CC stands for "carbon copy."

Hope this helps! Please mark me as brainliest!

Have a wodnerful day!

When an external device becomes ready to be serviced by the processor the device sends a(n)_________ signal to the processor.

Answers

when an external device becomes ready to be serviced by the processor the device sends a(n) interrupt signal to the processor

Other Questions
It is believed that the ratio of cyclic electron transport to Z-scheme photosynthesis changes in response to metabolic demands. If a plant were actively engaged in a large amount of reductive biosynthesis, requiring NADPH, how would it alter these processes compared to a plant just performing the Calvin cycle to produce glucose F is on the bisector of angle BCD. Find the length of FD (with lines over FD) List some rights of children and explain each in brief. For each kilogram of a persons weight 2.5 milligrams of a drug is to be given. what dosage should be given to a child who weighs 84 pounds? Use the fact that 1 lb = 0.45 kg how many inches is 775 centimeters write the first 10 multiples of 2 and 3 and find LCM. What is the area of a rectangle with vertices at (7,3) (12,3) (12,11) (7,11) look at the image below pls help Describe how to find the product of the two terms 3x^2y^5 and 4x^3y^7 The common stock of Eddie's Engines, Inc. sells for $45.68 a share. The stock is expected to pay $4.10 per share next year. Eddie's has established a pattern of increasing their dividends by 6.2 percent annually and expects to continue doing so. What is the market rate of return on this stock?a. 15.18 percentb. 7.26 percentc. 8.98 percentd. 17.67 percente. 11.14 percent What difference do you find between agrarian society and industrial society?make a list What are the features of Nuclear Receptor Screening Services?Nuclear receptors (NRs) are a class of proteins responsible for thyroid hormones and sensing steroid and certain other molecules. There are 48 genes in the human genome that code for the NRs. As the largest family of eukaryotic transcription factors, NRs control numerous processes involved in development, cell cycle, and important metabolic pathways.https://dda.creative-bioarray.com/nuclear-receptor-screening.html ax^2-y^2-x-y factorize If LM = 9x + 27 and RS = 135, find x. In the analogy of a cell as a school,lysosomes could be thought of as...A. a janitor.B. a teacher.C. a music teacher. Two observers are 300 ft apart on opposite sides of a flagpole. The angles ofelevation from the observers to the top of the pole are 20and 15. Find theheight of the flagpole. A door-to-door salesperson knocks on Mary's door and convinces her to purchase the Wonder Vacuum for $500. Soon after the salesperson leaves, Mary begins to have second thoughts about the transaction. Which statement about the situation is correct Which value of x makes this equation true?-9x+15=3(2-x) Are people in your country generally interested in studying , do you think? Explain why fabrics made with elastic fibre with the trade name lycra are extensively used in foundation garment industry today. You may use their special characteristics and properties.