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
Kay [80]
3 years ago
7

Create a Python script that enables a user to enter an integer number into the Python console and stores such integer number int

o a variable named input1. Use an if statement to print the following output per the following conditions:If integer is a negative number, print in console "Input1 integer is negative"If integer is zero, print in console "Input 1 integer is zero"If integer is a positive number less or equal than 30, print in console "Input 1 is positive but less or equal than 30.If integer is a positive number greater than 30, print in console "Input1 is positive and greater than 30"

Computers and Technology
1 answer:
DIA [1.3K]3 years ago
6 0

Answer:

Here is the Python program:

input1 = int(input("Enter an integer: ")) #prompts user to enter an integer

if(input1<0): #if input value is negative

    print("Input1 integer is negative")

elif(input1==0): #if input value is 0

    print("Input 1 integer is zero")

elif(input1<=30): #if input value is less than or equal to 30

    print("Input 1 is positive but less or equal than 30")

else: #if input value is greater than 30

    print("Input 1 is positive and greater than 30")    

Explanation:

I will explain the program with an example

Lets say user enters 16 as input So

input1 = 60

Now the first if condition if(input1<0): is false because 60 is not less than 0

The second elif (else if) condition elif(input1==0): also evaluates to false because 60 is not equals to 0

The third elif condition elif(input1<=30): evaluates to false because the input value is 60 which is not less than or equal to 30.

The fourth else part executes because all the above if elif conditions evaluate to false which means the input number if neither negative, nor 0 and not less than or equal to 30. Hence the input number is greater than 30 and this is true as 60 is greater than 60. So the print statement executes which is:

    print("Input 1 is positive and greater than 30")

The message in the above print statement is printed on the output screen.

The screenshot of the program along with its output is attached.

You might be interested in
Which of the following is an acronym? A.RAM B.Every Good Boy Does Fine. C.association D.mnemonic device
neonofarm [45]

RAM is an acronym in the given following.

A.RAM

<u>Explanation:</u>

From the given options,  RAM stands for Random Access Memory. RAM comes under primary memory and is a volatile memory, which means the contents of a RAM are lost when the power is turned off.

The man function of RAM is to hold the data when it is being processed. Whenever the user tries to access a program or data, the control unit looks for the program first in the cache memory and then in the RAM for faster access and execution.

If the program is nowhere to be found in the RAM then it is searched in the secondary memory.

7 0
3 years ago
Answer is B because portrait is define that they take only photographs of people and like to communicate with people they are we
quester [9]
Ty ive been looking for that answer
5 0
3 years ago
Structured walk-throughs take place throughout the SDLC and are called _____ reviews, depending on the phase in which they occur
Tpy6a [65]

Answer:

design

Explanation:

Based on the information provided within the question it can be said that these are called design reviews. This is one of the most important parts of the development of a system. This focuses more on answering how something is going to be done in the system as opposed to answering what is going to be done for the system depending on the questions asked in the analysis phase.

5 0
3 years ago
To ensure rapid recovery and security of data, backup data should be ________.
Nataly [62]

Answer:B kept at a secure location at the facility

Explanation:

8 0
3 years ago
Which computer program can you use to write, edit, print, and perform any modifications to a document?
faltersainse [42]
D. word-processing software
4 0
4 years ago
Read 2 more answers
Other questions:
  • Your friend wants to know about Microsoft Expression Web 4. Which of the following terms will you use to describe Microsoft Expr
    5·1 answer
  • A triangle is an example of __________ .
    9·1 answer
  • What will you see on the next line?
    6·2 answers
  • What are folders within folders called​
    8·2 answers
  • And tags are examples of stand - alone tags.
    15·1 answer
  • Jacob is a website designer. Whenever his company takes on a new project, Jacob takes the initiative and comes up with ideas and
    14·1 answer
  • A sequential algorithm is broken into three stages
    14·2 answers
  • Which of the following can you use to judge source legitimacy?
    6·2 answers
  • Please please help I don’t understand this please.
    11·1 answer
  • a company recently implemented a secure sockets layer/transport layer security (ssl/tls) version that supports secure hashing al
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!