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]
3 years ago
12

Must be python format

Computers and Technology
1 answer:
Irina18 [472]3 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
which of the following is not a step of the scientific method A.identifying the problem B.making observations C. making a hypoth
dangina [55]
I believe the correct answer is choice D. Making a law.

I don't believe the scientific method says anything about making a law.

I hope this helps you and have a great day!
3 0
4 years ago
Please tell fast plzzzzzz.​
lana [24]

Answer:

True

Explanation:

4 0
3 years ago
Is there an answer to these picture?
Tomtit [17]

Answer:

yes there is an answer to this question

6 0
3 years ago
The best ways to navigate through your computer? a)Start button b)My Computer c)Windows explorer d)All of the above​
melomori [17]

Answer:

d all of above cause from tht all we can navigate through our pc

7 0
3 years ago
Give a recursive version of the algorithm Insertion-Sort (refer to page 18 in the textbook) that works as follows: To sort A[1..
Inga [223]

Answer:

see explaination

Explanation:

void insertion( int e,int *x, int start, int end)

{

if (e >= x[end])

x[end+1] = e;

else if (start < end)

{

x[end+1] = x[end];

insertion(e, x, start, end-1);

}

else

{

x[end+1] = x[end];

x[end] = e;

}

}

void insertion_recurssion(int *b, int start, int end)

{

if(start < end)

{

insertion_sort_recur(b, start, end-1);

insertion(b[end], b, start, end-1);

}

}

void main()

{

insertion_recurssion(x,0,5);

}

3 0
3 years ago
Other questions:
  • What is primary storage
    11·2 answers
  • When should you use the Reply All function when replying to an email
    10·2 answers
  • The windows troubleshooting utility that identifies and eliminates nonessential files is called _____.
    15·2 answers
  • Which relation is created with the primary key associated with the relationship or associative entity, plus any non-key attribut
    6·1 answer
  • 1. Se requiere implementar un conversor unipolar que tendrá una tensión analógica variable entre 0 y 2 V pico. Deberá tener una
    10·1 answer
  • 1. Which sentence best expresses the main idea
    12·1 answer
  • How are switches indirectly involved in ARP poisoning?
    10·1 answer
  • Which of the following is a database concept that allows for storage and analysis for a dozen to billions of data points?
    7·1 answer
  • How Powerpoint is useful in education aspect?
    5·2 answers
  • Zohan uses the following analogy to describe a concept of object-oriented programming. A button can have many uses. When it is p
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!