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!
The appropriate response is colosseum. It is otherwise called Coliseum and Flavian Amphitheater is an oval amphitheater in the focal point of the city of Rome, Italy. Worked of cement and sand, it is the biggest amphitheater at any point assembled.
Answer:
Python code is explained below
Explanation:
# decorator.py starts
def uppercase(fcn):
def wrapper():
original = fcn;
modified = str(fcn).upper() ;
return modified;
return wrapper();
# decorator.py ends
# greet.py starts
import decorator #to generate the decorator
def greetings(): #invokes the greetings function for output
print("Hello");
print(decorator.uppercase(greetings));
# greet.py ends
Answer:
Explanation:
A general idea is that you should repeat the simulation until the results converge. An easy but illustrative example of this is that we want to see if the R function rbinom is accurate in simulating a coin toss with a given probability. We will simulate one coin toss 10000 times, and plot the percentage of heads against the number of coin tosses:
set.seed(1)
n <- 10000
result <- NULL
percent <- NULL
for (i in 1:n) {
result[i] <- rbinom(1,1,0.5)
percent[i] <- sum(result)/i
}
plot(seq(1:10000),percent, type="l")
abline(0.5, 0, lty=2)
<span>The trap command is useful when you want your shell program to automatically remove any temporary files that are created when the shell script runs. The trap command is a basic, but a very beneficial tool. If the script generates temporary files, like a simple script that changes FOO for BAR in entirely files in the existing directory, /tmp file will be clean when you exit the script.</span>