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
Inessa05 [86]
2 years ago
12

Must be python format

Computers and Technology
1 answer:
Irina18 [472]2 years ago
7 0

import random

to_guess = random.randint(1, 1000)

count = 0

guess = 0

while guess != to_guess:

   guess = int(input("Guess a number between 1 and 1000? "))

   while guess < 1 or guess > 1000:

       guess = int(input("Whoops, guess a number between 1 and 1000? "))

   count += 1

   if guess > to_guess:

       print("Your guess is too high! Try a lower number.")

   elif guess < to_guess:

       print("Your guess is too low!. Try a higher number.")

print("You got it! The number is " + str(to_guess)+" and you got it in " + str(count) + " guesses!")

I hope this helps!

You might be interested in
Write a do-while loop that continues to prompt a user to enter a number less than 100, until the entered number is actually less
Ad libitum [116K]

Answer:

#include<iostream>//library inclusion

using namespace std;

int main()

{

int userInput;

do//start of do while loop

{

 cout << "Enter a number less than a 100" << endl;

 cin >> userInput;

 if (userInput < 100) //condition

 {

  cout << "YOu entered less than a hundred: " << userInput << endl;

 }

 else

 {

  cout << "your number is greater than 100" << endl;

 }

} while (userInput > 100);//condition for do while

return 0;//termination of int main

}

Explanation:

The program has been commented for you. The do-while loop enters the first loop regardless of the condition. Then after the first iteration, it checks for the condition. If the condition is being met, it will iterate through, again. Otherwise it will break out of the loop and land on the "return 0;" line. Which also happens to be the termination of the program in this case. The if-else condition is used for the user to see when prompted.

6 0
2 years ago
Which phrases in the passage provide clues that trifling means "silliness” or "insignificance”? Check all that apply.
Alla [95]

Answer:

a c e

Explanation:

8 0
2 years ago
What was the job of the Committee of Correspondence? WILL GIVE BRANLEST AND 40 POINT
Wewaii [24]

Answer:

how many of these information have you shared

5 0
2 years ago
Assume that source elements of length k are mapped in some uniform fashion into a target elements of length p. If each digit can
lukranit [14]

Answer And explanation

a)

r^k has 1/r^k probability guess the correct source

b)

Each element in r^p  is mapped by r^k / r^p . There are r^k^-^p  So there are  r^k^-^p -1 elements.

number of target elements = r^k^-^p

number of source elements = r^k^-^p -1

probability = r^k^-^p -1 /r^k

c) Probability of the correct target element

1/r^p

6 0
2 years ago
In PowerPoint, a type of chart that, rather than showing numerical data, illustrates a relationship or logical flow between diff
Lynna [10]

Answer:

A. SmartArt

Explanation:

SmartArt is a graphical tool used to visually communicate information.

8 0
3 years ago
Other questions:
  • Business ethics are?
    9·1 answer
  • A network administrator has been tasked with configuring access to the Internet for about 50 computers. The administrator has be
    6·1 answer
  • Bill downloaded an antivirus software from the Internet. Under the Uniform Commercial Code (UCC), the software is a: Select one:
    15·1 answer
  • A finally clause will execute:
    8·1 answer
  • Write the function powersOf3ToN(n) that takes a possibly-negative float or int n, and returns a list of the positive powers of 3
    10·1 answer
  • What is the result when you run the following line of code after a prompt??
    5·1 answer
  • (Technical terms) The classification computer into five distinct phases.​
    5·1 answer
  • A customer dictates instruction on how to transcribe audio. Do you have to transcribe the instruction word for word?
    13·1 answer
  • A local pizza shop is selling a large pizza for $9.99. Given the number of pizzas to order as input, output the subtotal for the
    12·1 answer
  • What role does the automated surface observing system.
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!