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
Aleksandr [31]
3 years ago
14

Write a program that has a user guess a secret number between 1 and 10. Store the secret number in a variable called secret Numb

er and allow the user to continually input numbers until they correctly guess what secretNumber is. For example, if secretNumber was 6, an example run of the program may look like this:
Computers and Technology
1 answer:
Ganezh [65]3 years ago
8 0

Answer:

The program in Python is as follows:

import random

secretNum = random.randint(1,10)

userNum = int(input("Take a guess: "))

while(userNum != secretNum):

    print("Incorrect Guess")

    userNum = int(input("Take a guess: "))

print("You guessed right")

Explanation:

This imports the random module

import random

This generates a secrete number

secretNum = random.randint(1,10)

This prompts the user to take a guess

userNum = int(input("Take a guess: "))

This loop is repeated until the user guess right

while(userNum != secretNum):

    print("Incorrect Guess")

    userNum = int(input("Take a guess: "))

This is executed when the user guesses right

print("You guessed right")

You might be interested in
A computer hacker usually gets into a companyâs network by _____.
kap26 [50]
Decrypting and bringing down the whole firewall
3 0
4 years ago
List the seven basic internal components found in a computer tower
katrin2010 [14]

These are :

1. Central Processing Unit (CPU). This is the brain of the computer and performs the basic logical, arithmetic , input & output operations of the computer system.

2. RAM. This is Random Access Memory. It is used by the CPU when the computer system is running to temporarily store information which needs to be used quickly and  which would otherwise be lost when there is no power.

3. Motherboard. This is a crucial  part that holds together the  critical components of a computer including the CPU, memory and input/output connectors.

4.Hard drive. This is the component that stores data permanently.

5. Power supply unit. This is  a component that converts mains AC power to DC power for use by the internal parts of the computer.

6. Cooling system. This consists mainly of fans attached to computer enclosures that maintain inflow of cool air and expelling of hot air out of the computer tower.

7. Frame. This is the hard casing that houses  the computer parts protecting them and keeping them together.


 

4 0
3 years ago
Read 2 more answers
Which of the following is the net effect of the following combination of share and NTFS permissions when the share is accessed o
katen-ka-za [31]

Answer:

Members of the Sales group will be able to edit content and delete files.

Explanation:

NTFS (New Technology File System) is the standard file system for Microsoft Windows NT and later operating systems; NTFS permissions are used to manage access to data stored in NTFS file systems.

Share permissions manage access to folders shared over a network; they don’t apply to users who log on locally.

The share permission is applicable in this question.

On the security tab, where the sales group have read & execute, modify and write permission will allow the sales group users to

1. Modify: allows you to read, write, modify, and execute files in the folder, and change attributes of the folder or files within

2. Read and Execute: will allow you to display the folder's contents and display the data, attributes, owner, and permissions for files within the folder, and run files within the folder

3 0
3 years ago
What advantage does digital storytelling have over oral storytelling traditions?
Marysya12 [62]
Pretty sure the answer is D
6 0
4 years ago
3) An algorithm has a run time of O(nk ) for some integer k. On an input of size 500, the algorithm takes 16 seconds to run. On
lukranit [14]

Answer:

The value of k is 4

Explanation:

Solution

Given that:

k = integer

Input size = 500

The algorithm takes a run of = 16 seconds

Input size = 750

The algorithm takes a run of = 81 seconds

Now,

We have to determine the value of k

The equation is shown below:

(500)^k /16 = (750) ^k /81

Thus

(750/500)^ k = 81/16

= (3/2)^k

=(3/2)^ 4

k is = 4

6 0
3 years ago
Other questions:
  • Match the web development languages to their type.
    13·1 answer
  • Monetary Policy can be either Expansionary or Contractionary. Which of the following actions classify as Expansionary Monetary P
    7·2 answers
  • Define a function below, get_subset, which takes two arguments: a dictionary of strings (keys) to integers (values) and a list o
    8·1 answer
  • Cecelia would like to write an app to help manage a trip to the grocery store. The app will maintain a shopping list (a list of
    7·1 answer
  • What do you need to know when buying screws<br>​
    12·2 answers
  • Assume that month is an int variable whose value is 1 or 2 or 3 or 5 ... or 11 or 12. Write an expression whose value is "jan" o
    10·1 answer
  • You want to substitute one word with another throughout your
    13·1 answer
  • LIST THE BEST 10 3D PRINTERS WITH THEIR RESPECTIVE APPS.
    14·1 answer
  • What are two reasons why a switch port would have a status of errdisable? (choose two. )
    14·1 answer
  • A project manager has designed a new secure data center and has decided to use multifactor locks on each door to prevent unautho
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!