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
You need to install a customized console on 10 computers. what is the best way to do that?
ICE Princess25 [194]
So you're going to simply create, copy, and paste!  You're going to create your first console on the first computer, and the you'll be left with a .mmc file which you're going to copy and paste to the other nine.  As long as you can get that file over through a shared server connection, you should be fine!
6 0
3 years ago
0 Select the correct answer. Which is an advantage of programming with a procedural language? A. Procedural program code is easy
Novosadov [1.4K]

Answer:

D. Algorithms of simple problems are readily available for reference. ​

Explanation:

Hope this helps you! Ask me anything if you have any quistions!

7 0
2 years ago
18. Which type of briefing is delivered to individual resources or crews who are assigned to operational tasks and/or work at or
GrogVix [38]

Answer: Field-level briefing

Explanation: Field-level briefing is the brief description that is provided to the crew members or operation task holders.This briefing contains the information about the work and operation that are to be followed by the workers on the site .

Field level briefing is sort of instructions to individual or group of people who will be working with their assigned duties on the incident site.

8 0
3 years ago
A grade of B is worth Grade points<br><br><br> A) 3.0<br> B) 80<br> C)2.0<br> D)4.0
Elodia [21]

Answer:

I am pretty sure. In my view answer is 4.0

8 0
3 years ago
Read 2 more answers
Fuel-pressure regulators on fuel-return-type fuel-injection systems are installed
Natalija [7]
1) The correct answer is <span>B. at the end of the fuel rail.
2) The one who is correct is the Technician A.</span>
5 0
3 years ago
Read 2 more answers
Other questions:
  • Assume that an int variable age has been given a value. Assume further that the user has just been presented with the following
    14·1 answer
  • What cell address indicates the intersection of the first row and the first column in a worksheet?
    15·2 answers
  • Write a program that continually prompts the user for an integer input until input is entered that is less than 0. Each input th
    9·1 answer
  • Was the type writer the first part of the keyboard? ​
    8·1 answer
  • This exspansion slot essentially replaced PCI and AGP slots
    14·1 answer
  • What's the inputs and outputs in a kitchen?
    14·1 answer
  • Research the topic of legal and ethical behaviors or dilemmas related to technology. Identify five topics of concern and briefly
    9·1 answer
  • Define the function max2 that takes two integers as arguments and returns the largest of them. Then define the function max_list t
    11·1 answer
  • In what ways is the human brain like a computer? In what ways is it different?
    14·2 answers
  • How do I do this??? (Im in 9th)
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!