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
GarryVolchara [31]
2 years ago
15

Create a program in Python that prompts the user to enter an integer number within the range of 1 to 10 inclusive. The program s

hould display “correct input” if the input is within the given range else it should display “wrong input”.

Computers and Technology
2 answers:
lapo4ka [179]2 years ago
8 0

Answer:

dont know if it works!

Explanation:

input=(input("enter number")

if input > 1

print("correct input")

if input <10

print("correct input")

else

print("wrong input")

Gwar [14]2 years ago
7 0

Python Code with Explanation:

# create a function named func to implement the required logic

def func():

# get the input from the user and store it in a variable named number

   number = int(input("Please enter an integer between 1 to 10 inclusive\n"))

# if the input number is equal or greater than 1 and equal to 10 or less then the input is correct    

   if number>=1 and number<=10:

# print correct input

       return print("Correct input")

# else the input is wrong

   else:

# print wrong input

       return print("Wrong input")

# call the function func

func()

Output:

Test 1:

Please enter an integer between 1 to 10 inclusive

4

Correct input

Test 2:

Please enter an integer between 1 to 10 inclusive

0

Wrong input

Test 3:

Please enter an integer between 1 to 10 inclusive

11

Wrong input

You might be interested in
Every windows service has the 3 start types what are those service types?
spayn [35]

Answer:

You can stop, pause, start, delay start, or resume each service as appropriate. You can also modify the start mechanism (Manual or Automatic) or specify an account. Windows Services broadly fall into three categories depending on the actions and applications they control: Local Services, Network Services and System.

5 0
2 years ago
Melissa is the network administrator for a small publishing company. as network administrator, she is in charge of maintaining t
Arte-miy333 [17]
The answer is an Intruder Prevention System (IPS). An Intrusion Detection System (IDS) will detect an attack but will not block it.
3 0
3 years ago
Write a lottery program that will ask the user if they would like to pick 5 numbers (1-30) or if they would like to choose EZ Pi
Llana [10]

Answer:

Explanation:

The following code is written in Python and creates arrays for the user's numbers and the next chance numbers, it also creates a cost variable and a did_you_win variable. The function takes in the winning numbers as an array parameter. It asks all the necessary questions to generate data for all the variables and then compares the user's numbers to the winning numbers in order to detect if the user has won. Finally, it prints all the necessary information.

import random

def lottery(winning_numbers):

   user_numbers = []

   next_chance_drawing = []

   cost = 0

   did_you_win = "No"

   #print("Would you like to choose your own 5 numbers? Y or N")

   answer = input("Would you like to choose your own 5 numbers? Y or N: ")

   if answer.capitalize() == "Y":

       for x in range(5):

           user_numbers.append(input("Enter number " + str(x+1) + ": "))

   else:

       for x in range(5):

           user_numbers.append(random.randint(0,31))

           cost += 1

   next_chance = input("Would you like to enter a Next Chance drawing for $1.00? Y or N: ")

   if next_chance.capitalize() == "Y":

       for x in range(4):

           next_chance_drawing.append(random.randint(0, 31))

           cost += 1

           

   if user_numbers == winning_numbers or next_chance_drawing == winning_numbers:

       did_you_win = "Yes"

   print("User Numbers: " + str(user_numbers))

   print("Next Chance Numbers: " + str(next_chance_drawing))

   print("Cost: $" + str(cost))

   print("Did you win: " + did_you_win)

6 0
2 years ago
A video consists of a sequence of:
PolarNik [594]
A) Frames. Is the anwser!!
4 0
1 year ago
The following equations estimate the calories burned when exercising (source): Men: Calories = ( (Age x 0.2017) — (Weight x 0.09
sammy [17]

In python:

age = float(input("How old are you? "))

weight = float(input("How much do you weigh? "))

heart_rate = float(input("What's your heart rate? "))

time = float(input("What's the time? "))

print("The calories burned for men is {}, and the calories burned for women is {}.".format(

   ((age * 0.2017) - (weight * 0.09036) + (heart_rate * 0.6309) - 55.0969) * (time / 4.184),

   ((age * 0.074) - (weight * 0.05741) + (heart_rate * 0.4472) - 20.4022) * (time / 4.184)))

This is the program.

When you enter 49 155 148 60, the output is:

The calories burned for men is 489.77724665391963, and the calories burned for women is 580.939531548757.

Round to whatever you desire.

6 0
3 years ago
Other questions:
  • When a relationship is established between two or more arrays by using the same subscript to relate entries between the arrays,
    14·2 answers
  • Buildings must be wired to comply with the latest National Electrical Code to ensure that, with adequate maintenance, the instal
    11·1 answer
  • Put the following five steps in the order in which you would perform them to use the Paste Special function. 1. Select and copy
    6·1 answer
  • You have been using the same computer for several years. To extend its service life, you decide to upgrade the processor. You ch
    13·1 answer
  • Select the correct answer.
    10·2 answers
  • Do debit cards offer the highest level of fraud pretection?
    10·1 answer
  • 2. Which of the following is a shortcut key to Exit from any operation?
    10·2 answers
  • Drag the tiles to the boxes to form correct palrs.
    9·1 answer
  • A friend asks you to look over the code for an adventure game and help figure out why it won’t work. Which of these options is s
    5·2 answers
  • A pseudo code that asks the user for their forename and their surname , and then outputs both, separated by a space to the user​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!