1.
Q11: Put the code in the right order to create a program that will continue to generate integers between 1 and 100 (inclusive) until the value generated is less than 6 or greater than 95. Print the numbers generated.
num_bad_inputs = 0
num = int(input("Input a number between 1 and 100: "))
while num < 1 or num > 100:
num_bad_inputs += 1
num = int(input("Input a number between 1 and 100: "))
print("failed inputs: " + num_bad_inputs)
evens = 0
odds = 0
num = int(input("Enter a number: "))
while num > 0 and num < 50:
if num % 2 == 0:
evens += 1
else:
odds += 1
num = int(input("Enter a number: "))
print(evens + "even(s) entered and " + odds + " odd(s) entered")
sum = 0
num_scores = 0
num = int(input(“Score: ”))
while num >= 0 and num <= 100:
sum += num
num_scores += 1
num = int(input(“Score: ”))
print(sum / num_scores)
a = 10
b = 5
counter = 1
while counter < a or counter < b:
if counter % 2 == 0:
counter *= 2
else:
counter += 1
print(counter)