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
MA_775_DIABLO [31]
3 years ago
5

PYTHON

Computers and Technology
1 answer:
Korvikt [17]3 years ago
6 0

Answer:

import random

print("Hello! I have a random number from 1 to 100! It is your job to try and guess it!")

number = random.randint(1,101)

guess = int(input("start to guess: "))

num_guesses = 1

while guess != number:

   if guess > number:

       print("lower")

       guess = int(input("try again: "))

       num_guesses +=1

   elif guess < number:

       print ("higher")

       guess = int(input("start to guess: "))

       num_guesses +=1

print("congrats it took you", num_guesses, "tries")

Explanation:

You might be interested in
How to the inverse function of f(x)=x2 +1 ,x&gt;o
Sindrei [870]
    f(x) = x² + 1, x > 0
       y = x² + 1
       x = y² + 1
   x - 1 = y²
√x - 1 = y
√x - 1 = f(x), x > 1
5 0
3 years ago
Animation and transition effects will distract your audience when using a slide show presentation aid. True or false ?
lions [1.4K]
I suspect the answer they're looking for is false. However, as an experienced professional in learning and development, I can tell you that when done right these effects can enhance a presentation.
4 0
3 years ago
Read 2 more answers
I have a lot of stuff on my pc and I want to make my pc brand new from when I bought it, How do I clean my pc to make it where i
stepan [7]
Well if your talking about physically you could get some compressed air and blow it out. Or if your talking about performance you could try to re-install the os you have on it or replace the hdd with a ssd or higher performance hard disk for it to run like new. :)
5 0
3 years ago
Read 2 more answers
Consider the recursive method whose definition appear below. Why? public static String mysteryString (String s){ if(s.length()==
Marizza181 [45]

Answer:

retupmoc

Explanation:

1.) Anwser will be retupmoc

because

public static String mysteryString(String s){

if(s.length() == 1){

return s;

}

else{

return s.substring(s.length() -1) + mysteryString(s.substring(0, s.length()-1));

}

}

In this program input is "computer" . So the function mysteryString(String s) it does

return s.substring(s.length() -1) + mysteryString(s.substring(0, s.length()-1));

so when it enters the first time ??s.substring(s.length() -1) and it will be give you 'r' then it calls the function recursively by reducing the string length by one . So next time it calls the mysteryString function with string "compute" and next time it calls return s.substring(s.length()-1)? + mysteryString(s.substring(0,s.length-1)) so this time it gives "e" and calls the function again recursively . It keeps on doing till it matched the base case.

so it returns "retupmoc".

6 0
3 years ago
When naming a file you should use the ___ instead of a space in a filename
Ymorist [56]
The underscore.
But actually you can use spaces in file names, in many file managers. I think it just shows you a space while it actually saves an underscore, or something like this.
5 0
3 years ago
Other questions:
  • ____________ are collected from several entities at the same point in time.
    13·1 answer
  • Two machines can finish a job in StartFraction 20 Over 9 EndFraction hours. Working​ alone, one machine would take one hour long
    10·1 answer
  • This is for career exploration, I need help please! &lt;3 HELPPPP
    8·2 answers
  • If you wanted a smartphone with the fewest restrictions on application development which smartphone operating system should you
    9·1 answer
  • Write a program in C/C++ to draw the following points: (0.0,0.0), (20.0,0.0), (20.0,20.0), (0.0,20.0) and (10.0,25.0). For this
    6·1 answer
  • A style sheet consists of CSS ______________________ that specify the layout and format properties to apply to an element. *
    13·1 answer
  • Four reasons why computers are powerful
    14·1 answer
  • Meera has created a small program in Python. She wants to store elements of the same data type in an organized
    7·1 answer
  • Which is the fastest memory in computer​
    9·2 answers
  • How do you create a function in C++
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!