Write a program that reads two numbers from the user, and proceeds as follows: If the input numbers are equal, the program displays: both numbers are the same. Otherwise, the program logs all the integers in the range of the input numbers from the smaller value to the larger value in the console. For example, if the user enters 22 and 16, the program displays: 16 17 18 19 20 21 22. Note that all the numbers are displayed in one line separated by a single space. . If any of the input values are invalid, the program displays an error message and terminates.​

Answers

Answer 1

import sys

x = input("enter number 1: ") #ask for user input

y = input("enter number 2: ")

output = "" #the output string

try: #try integering them (this also has error message and will check if input is valid)

 x = int(x)

except:

 print("error! number 1 was not a number :(")

 sys.exit() #leave

try:

 y = int(y)

except:

 print("error! number 2 was not a number :(")

 sys.exit()

if x == y: #check they are not the same

 print("both numbers are the same")

else: #do the thing

 if y > x: #otherwise swap the order

   for i in range (x, y + 1): #+1 for inclusive

     output = (output + str(i) + " ")

 else:

   for i in range (y, x + 1):

     output = (output + str(i) + " ")

 print(output) #so it's all in one line


Related Questions

Question 1 of 10
Which abbreviation is used to describe one type of long-term computer
memory?
O A. SCRAM
O B. DRAM
O C. ROM
O D. RAM

Answers

Answer:

C) ROM

Explanation:

In a computer, RAM is the short term memory. On the other side, ROM is the long term memory. Other examples of long term memory: Hard disk or SDD. Rest all of the options - SCRAM, DRAM, RAM are memory chips.

Answer:

C. ROM

Explanation:

The image was provided for explanation.

Hoped it helped.

what is the input for air cooler computer science​

Answers

Answer:

cooling

Explanation:

Air cooling is a process of lowering air temperature by dissipating heat. It provides increased air flow and reduced temperatures with the use of cooling fins, fans or finned coils that move the heat out of a casing such as a computer …

Question 9
The district purchases a web resource for the elementary campuses, but you
want to use it with your 9th grade students who need remediation. This would be
allowed because the district has extra licenses.
O True
False?

Answers

i think this is false im not sure tho

a software copyright?​

Answers

Answer:

Software copyright is the application of copyright in law to machine-readable software. While many of the legal principles and policy debates a concerning software copyright have close parallels in other domains of copyright law, there are a number of distinctive issues that arise with software

PLEASE HELP!! THIS IS DUE SOON.

An optical drive is used to send information to the cloud.

A. True

B. False

Answers

Answer:

The correct answer should be false.

Explanation:

I'm not so sure, so let me know if you got it worng.

And can I please have brainliest if it is correct?

Question 4 of 10
To find an image's____
count the number of pixels across each inch of the image.
A. binary value
B. bitmap
C. pixel density
D. RGB value

Answers

C. pixel density ii belive

what does command Array.GetItemcount do?

Answers

Answer:

According to https://smallbasic-publicwebsite.azurewebsites.net/docs/Array - "Gets the number of items stored in the array."

Explanation:

Walter and Layla own neighboring cornfields. Walter harvested 5/8 of an acre of corn on Monday and Layla harvested 3/8 of an acre. How many more acres did Walter harvest than Layla?

Answers

Answer:

2/8 or if you have to reduce it, you could do 1/4

Explanation:

Walter = 5/8 on Monday

And

Layla harvested = 3/8

So you just do

5/8 - 3/8 = 2/8

You can check it by doing 2/8 + 3/8 = 5/8

The first generation computers are likely to have been inverted in what period?

A. 1910s

B. 1920s

C. 1930s

D. 1940s

Answers

The first generation computers are likely to have been inverted in the period of the  1940s.

What is the era in 1st generation of computer?

The era is known to be around 1940-1956. This is said to be the period where the first set of computers were made.

Note that the first generation is one that vacuum tubes as the basic parts for memory and thus The first generation computers are likely to have been inverted in the period of the  1940s.

Learn more about  first generation computers  from

https://brainly.com/question/14713070

#SPJ1

1. How is the pronoun their used in the second sentence?
The students in Mrs. Powell 's classroom completed the service project in record time. Their
contributions to the community were broadcast on the local news,
A. To link a subject with the word(s)that describes it
B. To replace prepositions
C. To show possession
D. To replace an article like the or an

Answers

The pronoun is used in the second sentence as To link a subject with the word(s)that describes it.

What is a pronoun?

This is known to  be a word or phrase that is said to be used to replace a noun or noun phrase.

Note that in the above sentence, the pronoun " their" is used to The pronoun is used in the second sentence as To link a subject with the word(s)that describes it as it tells more about service project.

Learn more about pronoun from

https://brainly.com/question/395844

#SPJ1

Design a flowchart or pseudocode for a program that accepts two numbers from a user and displays one of the following messages: First is larger, Second is larger, Numbers are equal?

Answers

The pseudocode of the program will ask of two numbers form the user, compare the numbers and print out statements depending on the result of the comparison.

What is a pseudocode?

Pseudocode is an informal way of programming description that does not require any strict programming language syntax. The pseudocode describes how the code will be written and structured.

Therefore, the pseudocode follows the structure below

Ask the user for two numbersUse the greater than and equals to operator to check if any number is greater than the other or they are the sameFinally, we print the statements: First is larger, second is larger or numbers are equal depending on your result in comparison of the numbers.

learn more on pseudocode here: https://brainly.com/question/14101532

#SPJ1

Which of the following types of promotion includes a two-way conversation?

Answers

It would be C. Personal selling. Hope it helps!
where are the answer choices?

30 POINTS!

Which of the following describes an iteration in a computer program?

a set of instructions that causes a number to be printed

a set of instructions that causes the program to stop running

a set of instructions that can be executed multiple times

a set of instructions that does not execute any code​

Answers

The option that describes an iteration in a computer program is a set of instructions that can be executed multiple times.

What tells about an iteration in a computer program?

In computer programming, the term iterative is known to be the act where product design or its application is made better via consistent review and testing.

Therefore saying that The option that describes an iteration in a computer program is a set of instructions that can be executed multiple times is correct.

Learn more about iteration from

https://brainly.com/question/25754804

#SPJ1

Answer:

C. a set of instructions that can be executed multiple times

Explanation:

A license agreement specifies the number of
devices on which you can install the product, any
dates of expiration, and other restrictions. True or false?

Answers

The statement that a license agreement specifies the number of devices on which you can install the product, any dates of expiration, and other restrictions is true.

What is a license agreement?

A license agreement is a formal agreement that is given to a person to do or use something.

It is a legal contract between people or government and a person to authorize over any product.

Thus, the given statement is true.

Learn more about license agreement

https://brainly.com/question/14681311

#SPJ1

A computer has 32-bit virtual addresses and 4-KB pages. The program and data together fit in the lowest page (0–4095) The stack fits in the highest page.
1.How many entries are needed in the page table if traditional (one-level) paging is used?
2.How many page table entries are needed for two-level paging, with 10 bits in each part?

Answers

The numbers of entries needed is that:

For a one-level page table, one needs  232/212 or 1M pages needed.  Note that the page table must have 1M entries.

Can I run a 32-bit virtual machine using a 64-bit OS?

Others are:

For two-level paging, the main page table must have 1K entries, each have to points to a second page table. Note that only two of these are to be used.

Therefore, in full, only three page table entries are said to be needed, where one in the top-level table and another in each of the lower-level tables.

Note that one can install a 32-bit virtual machine in 64-bit Windows 10 system as it is very possible as long as the processor aids Virtualization Technology (VT).

Learn more about computer from

https://brainly.com/question/24540334

#SPJ1

Please help its timed! Which of the following is an event? Select 4 options. adding three and four in a program. moving a mouse. clicking a mouse button. a sensor detecting the motion of an earthquake detector. scanning a credit card when you shop? ​

Answers

The option that is an event is known to be clicking a mouse button.

What is a computer event?

An event, in a computing context, is known to be any kind of action that aim to know or  is identified by a program and has a good importance for system hardware or software.

Events  examples  keystrokes and mouse clicks, program loading and others. so we can say that the option that is an event is known to be clicking a mouse button.

Learn more about  program from

https://brainly.com/question/1538272

#SPJ1

.....................................................

Answers

Answer:

i think its, a. sequence

Explanation:

i could be wrong, if i am, i am sorry

In java language I want the code

Answers

Answer:

code was too long to paste here, attached below

When replacing a system board for an OEM system, what are the recommended steps to take? Select two options that apply.

Answers

When replacing a system board for an OEM system, the recommended steps are A. Run Easy Restore to install the OEM ID. If Easy Restore fails, manually reinstall the OEM ID module while the manufacturing mode is still enabled/detected on the replaced system board.

B. Replace the system board, verify the server boots fully before reinstalling the OEM identity (ID) module.

What is OEM system?

OEM means original equipment manufactures. OEM makes computer system and products that are used by another company's end product.

Thus, the correct options are A and B.

Learn more about OEM system

https://brainly.com/question/23988969

#SPJ1

HELP ME PASS!
Type the correct answer in the box. Spell all words correctly.
Nathan is creating a presentation for the employees at his office. Which media element should he use in the navigational buttons and menus in his presentation?
Nathan should use text or BLANK elements for the navigational buttons and menus in his presentation.

Answers

Nathan should use text or or  Action button elements for the navigational buttons and menus in his presentation.

What is an Action Button?

An action button is known to be an object that can be seen on a slide that helps one to be able to clicked or pointed to anything on a presentation.

Note that they are often used in self-running presentations and as such, Nathan should use text or or  Action button elements for the navigational buttons and menus in his presentation.

Learn more about presentation from

https://brainly.com/question/24653274

#SPJ1

I need help including my other one I posted

Answers

Answer:

2. I like the form of it, I like the porportion of it.

3. I dont know what a purpose of this maybe it a person wearing a tuexdo stepping out of his house or something.

4. Another thing that would work well is texture.

What will be the output of the following code snippet?

Answers

Answer:

D

Explanation:

Its gonna be of the class integer.

Explain the stages of the evolution of the idea of IDS and its importance of security, military and examine the importance of intrusion detection systems and categories classifications, and where can put IDS to reduce the risk to the network.

Answers

Intrusion detection systems (IDS) is a software type that is used to check for violations of policy or any other malicious activity. IDS detects and prevents unauthorized activities.

What is IDS?

Intrusion detection systems (IDS) is the technological system that is built to check for any suspicious and unauthorized activities. They detect the network system and the system logs.

The unauthorized and suspicious things are scanned and made an alert. It is very crucial in many fields as many documented and private items are needed to be protected.

Therefore, IDS can be of various types like host, network, perimeter, and VM.

Learn more about IDS here:

https://brainly.com/question/20709626

#SPJ1

An example of a processing device would be

Answers

Answer:

Central processing unit (CPU) Graphics processing unit (GPU) Motherboard. Network card.

Explanation:

as my study I know this answer I hope it will be help full

Network card, Graphics processing unit, Motherboard, Central Processing unit, Digital Signal Processor, the list goes on.

c. What are the four basic operations in a computer? Define each of them wit help of block diagram.

Answers

Answer:Answer: At a fundamental level, computers operate through these four functions: input, output, processing, and storage.

Explanation:  Input is something entered into a machine or other system, the act of entering data or other information, or input can also describe giving one's help, advice or thoughts.

Output is defined as the act of producing something, the amount of something that is produced or the process in which something is delivered.

An example of process is the steps taken by someone to clean a kitchen. An example of process is a collection of action items to be decided on by government committees. noun.

A storage device is any type of computing hardware that is used for storing, porting or extracting data files and objects.

Explanation:

How far should you sit from your computer screen?
PLS ANSWEER ASAP

6 to 12 inches

12 to 18 inches

18 to 24 inches

24 to 30 inches

Answers

im sorry but none of these THE REAL ANSWER IS 16 to 30 inches
Yes the answer is 16 to 30 inches
Non of these are the answer

How many characters can be store on a disk with a capacity of 1.4mb

Answers

Answer: If you want an exact number of characters, this one is really peculiar. A 1.44MB diskette can hold 1.44 x 1000 x 1024 characters, which is 1,474,560 characters.

Explanation:

Which is an example of a foley effect?

Answers

Answer:

Foley artists reproduce everyday sounds like footsteps, doors opening and closing, wind blowing, glass breaking, and other ambient noise.

How to powerwash chromebook

Answers

Answer:

you only need to select restart after you sign out of your account also I would make sure everything you need is backed up because otherwise everything you have will get deleted I accidentally had that happen to me last week or the week before, I didn’t realize it was going to need to be reset so I didn’t save the majority of my answers. So now I have barely anything done and I’m behind.

Explanation:

I hope it helps you though.

_______Is the process of organizing data to reduce redundancy
O A. Specifying relationships
O B. Duplication
O C. Primary keying
O D. Normalization

Answers

Answer:

the answer is D

Explanation:

Normalization is the process of reorganizing data in a database so that it meets two basic requirements:

There is no redundancy of data, all data is stored in only one place.

Data dependencies are logical,all related data items are stored

Other Questions
The GDP of the United States in 2015 was about .From 2000 to 2015, the GDP has mostly .The GDP will most likely in the next five years. Let f(x) = x + 4x - 6 and g(x) = x + 2, find (f g)(x). #81 will gove brainliest to best answer Pls help will give brainilist From Animal Farm. Instructions: Read the following passages from Chapter IX. and explain the inferences and insights you can make that the characters cant. 1. Meanwhile, life was hard. The winter was as cold as the last one had been, and food was even shorter. Once again all rations were reduced, except those of the pigs and dogs. A too rigid equality in rations, Squealer explained, would have been contrary to the principles of Animalism. which of these numbers: 3,4,18,111,123,340,345,456,555 are divisible by 3 but not 9 A hemispherical tank is filled with water and has a diameter of 10 ft If water weighs 62.4 lb per cubic foot what is the total weight of water and a full tank in the nearest pound can i have help with this please if you do it you're a lifesaver What are the advantages and disadvantages of genetically modified organisms? Need done by tonight please! Will mark brainliest just need it done. In the text "White House Press Release Announcing the Bombing of Hiroshima August 6, 1945" by President Truman, in which country was the atomic bomb developed?A. GermanyB. The United StatesC. The United KingdomD. Japan A sample of (NH4)2SO3 that contains 6 000 oxygen atoms must also contain how many hydrogen atoms?Select one:O a. 16 000O b. 8 000O c. 4000O d. 6 000 In the context of Alabama in the 1900s, the UMWA wasculturally and historically significant because itsupported the civil rights movement.O was a segregated organization.O was an interracial organization.O supported coal mining companies. True or False? Sri Lanka can't get imported goods because the country is almost bankrupt.TrueFalse Mr. Diaz's birthday is August 5, 1961. The correct way to enter his date of birth into the database is a) 8/5/61. b) August 5, 1961. c) 08/05/1961. d) 8/5/1961 g(t)=tt421) What are the zeros of the function?Write the smaller t first, and the larger t second.smaller t=?larger t=?2) What is the vertex of the parabola?(?,?) Please help meWhich equation has the same solutions as x+6x-7=0 ?A) (x+3)=2B) (x-3)=2C) (x-3)=16D) (x+3)=16 examples of cultural lag Fullme Ph.D. students receive an average of $12,837 per year. If the average salaries are normally distributed with a standard deviation of $1500, find these probabilities. a. A student makes more than $15,000. b. A group of 36 students makes between $13,000 and $14,000. Suppose the heights of the members of a population follow a normaldistribution. If the mean height of the population is 72 inches and thestandard deviation is 3 inches, 99.7% of the population will have a heightwithin which range?A. 63 inches to 81 inchesB. 66 inches to 78 inchesC. 60 inches to 84 inchesD. 69 inches to 75 inches