a python program for the following output using for loop.

Output:


-13

-7

-1

Answers

Answer 1

Answer:

In Python

for i in range(-13,0,6):

   print(i)

Explanation:

Required: A program to display the given output

From the program, we observe the following:

The output begins at 13 i.e begin = 13

The output ends at -1 i.e end = 1

And the difference between each output is 6.

i.e. [tex]-1 - (-7) = -7 - (-13) = 6[/tex]

So, the syntax of the for loop is: (begin, end + 1, difference)

The program explanation goes thus:

This iterates through the -13 to 1 with a difference of 6

for i in range(-13,0,6):

This prints the required output

   print(i)


Related Questions

Other Questions
DeraseAn electric heater Consumes 1.8 MJ When connected to a 250V supply for 30 minutes. Find the power rating of the heater and the current taken from the supply is 250 000 miles from the earth to the moon" is a qualitativeObservationTRUEOr false Judy uses 12 tiles to make a mosaic. 8 of the tiles are blue. what fraction ,in simplest form, represents the tiles that are blue A snail travels at an average speed of 0.1 feet per hour for 15 minutes. How many feet will the snail travel? 1. The nominal rate on Sandra's loan is 7.125%. If the interest is compounded monthly, what rate ofinterest is Sandra actually paying? (use the formula) Which investment would make you the most interest? Explain.A: $450 at 7% for 10 yearsB: $1,300 at 5% for 6 years Why have the buildings of Siena been preserved and not modernized?A.The buildings have historic value.B.Florence became a bustling city and Siena was left behind.c.The townspeople decided many centuries ago that tourism would one day bring in a great profit,e Write a system of linear inequalities represented by the graph.Inequality 1:Inequality 2: For which of the equations below is x = 2 a solution?A 2 + x = 2B x - 7 = 5C 3x = 6 when a two digit number is multiplied by its unit digits, the product is 336. When the digits are reversed and the new number is multiplied by its new unit digits, the product is 325.If the sum of the digits is 11, find the original two digit number James recently got a credit card. The APR on the card is 19.8%. What is the monthly interest rate?A. 1.65%B. 7.8%C. 12%D. 19.8% A state began an effort to increase the deer population. In year 2 of the effort, the deer population in a state forest was 3,000. In year 4, the population was 4,320.The explicit rule for the geometric sequence is a = 10Tara is playing a party game in which a tiny ball isdropped into a rectangular box. To win the game, shemust guess where the ball will stop. What should sheguess to maximize her chances of winning?scribes the likelihood of the ballquare or rectangular shaped area?squarecircletriangleshaded area4 Why can't krypton and xenon separate during the separation of gases in the air? Charles decides to use part of his income each month to buy U.S. Savings Bonds. What advantage is there to buying Savings Bonds from the U.S. Treasury? More Savings Bonds are sold when the government needs money. Purchase of Savings Bonds adds to the government's debt. Savings Bonds are very high risk, but high paying, investments. Savings Bonds are repaid with interest by the federal government. The probability of choosing a green sweet at random from the bag is 1/12.Please see the picture, I need to answer that question. 3y - 5x = 15 slope intercept form How do I simplify fractions ? five ways on how I can apply what I've learned to real life i dont understand, explain also