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
timofeeve [1]
3 years ago
8

Write a program whose input is two integers. Output the first integer and subsequent increments of 5 as long as the value is les

s than or equal to the second integer. Ex: If the input is: - 15 10 the output is: -15 -10 -5 0 5 10 Ex: If the second integer is less than the first as in: 20 5 the output is: Second integer can't be less than the first. For coding simplicity, output a space after every integer, including the last. 5.17 LAB: Print string in reverse Write a program that takes in a line of text as input, and outputs that line of text in reverse. The program repeats, ending when the user enters "Done", "done", or "d" for the line of text. Ex: If the input is: Hello there Hey done then the output is: ereht olleh уен 275344.1613222
Computers and Technology
1 answer:
adell [148]3 years ago
3 0

Answer:

Following are the code to the given question:

For code 1:

start = int(input())#defining a start variable that takes input from the user end

end = int(input())#defining a end variable that takes input from the user end

if start > end:#use if that checks start value greater than end value

   print("Second integer can't be less than the first.")#print message

else:#defining else block

   while start <= end:#defining a while loop that checks start value less than equal to end value

       print(start, end=' ')#print input value

       start += 5#incrementing the start value by 5

   print()#use print for space

For code 2:

while True:#defining a while loop that runs when its true

   data = input()#defining a data variable that inputs values

   if data == 'Done' or data == 'done' or data == 'd':#defining if block that checks data value

       break#use break keyword

   rev = ''#defining a string variable rev

   for ch in data:#defining a for loop that adds value in string variable  

       rev = ch + rev#adding value in rev variable

   print(rev)#print rev value

Explanation:

In the first code two-variable "first and end" is declared that takes input from the user end. After inputting the value if a block is used that checks start value greater than end value and use the print method that prints message.

In the else block a while loop is declared that checks start value less than equal to end value and inside the loop it prints input value and increments the start value by 5.

In the second code, a while loop runs when it's true and defines a data variable that inputs values. In the if block is used that checks data value and use break keyword.

In the next step, "rev" as a string variable is declared that uses the for loop that adds value in its variable and prints its values.

You might be interested in
A mobile device you are troubleshooting is experiencing a sharp decrease in performance after an hour of operation. The user pow
Anna71 [15]

Answer:

Close or disable all unused running apps.

Explanation:

Closing programs running in the background on your computer or mobile device helps to free up system resources for your other programs. These problems can be resolved where your system is running slowly or two programs are trying to use the same device hence causing the device or system to drag.

5 0
2 years ago
Is Bob Lazar telling a lie/withholding information?
Anon25 [30]

Answer:

I think he may be a nut, but I'm not sure, there's little evidence of what he says to be true.

6 0
3 years ago
The keyboard,mouse, display,and system units are:​
Ymorist [56]

Answer:

input devices?

Explanation:

Keyboard: It is used to give input through typing of the keys in keyboard. Mouse: It is used to give input through clicking mouse or selecting the options. System unit: It collectively defines the motherboard and CPU of the computer.

7 0
3 years ago
Read 2 more answers
What is the maximum length of a text field can be?<br>​
Luda [366]

Answer:

4000 characters

Explanation:

I think the max is 4000 characters

7 0
1 year ago
Read 2 more answers
COULD U ANSWER THIS ???
vladimir1956 [14]

Answer:

B.lightning striking a tree

Explanation:

The crowd dispersing in all directions is not a closed-loop by any means, and students jogging around an oval track as well is not a closed-loop, and also not a cross country run from one point to another. However, the lightning striking a tree is a closed loop that best models a circuit. And as lightning strikes the tree, like a closed circuit, tree catches the fire, or in circuitry words, the current is generated, and tree catches the fire due to it, just like bulb starts glowing.

3 0
2 years ago
Other questions:
  • Based on the current economic situation do you expect the employment demand for graduating engineers to increase or decrease? Ex
    9·1 answer
  • In three to five sentences, describe how technology helps business professionals to be more efficient. Include examples of hardw
    10·1 answer
  • 6. The NADH and FADH2 produced during the Krebs cycle pass their electrons down the 7. __ __ __ __ __ __ __ __ __ __ __ __ __ __
    6·1 answer
  • What is my favorite color?<br> Red<br>Orange<br>Yellow<br>Blue <br>Gold<br>Silver
    13·1 answer
  • To give your app users the ability to open your app directly from other apps by clicking a link, you should use:.
    11·1 answer
  • A list of sources used for in-text citations that appears at the end of a document is called:
    10·1 answer
  • One friend claims that a dual-core system runs at twice the speed as a single-core system; another friend disagrees by saying th
    13·1 answer
  • Encrypting text allows us to encrypt and decrypt the text using a special key.
    9·1 answer
  • Which of the following would be least effective?
    10·1 answer
  • 69696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!