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
SVEN [57.7K]
2 years ago
13

A python program for the following output using for loop.

Computers and Technology
1 answer:
nikdorinn [45]2 years ago
6 0

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. -1 - (-7) = -7 - (-13) = 6

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

The program explanation goes thus:

<em>This iterates through the -13 to 1 with a difference of 6</em>

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

<em>This prints the required output</em>

   print(i)

You might be interested in
Who wants to give free points to me?
Bad White [126]

Answer:

I can :) just comment lol

3 0
3 years ago
Read 2 more answers
Which of the following is a good choice to help you stay organized when you are away from the office? A. Personal Information ma
Free_Kalibri [48]

Answer:

A

Explanation:

6 0
2 years ago
How does the action affect the end result of what you want to accomplish?
suter [353]

Whichever action you take to complete a task will inevitably affect the end result of whatever would need to be accomplished; whether this impact the task in a positive or a negative way.

3 0
2 years ago
A program that helps computer users do specific things like word processing, etc., e-mailing, or browsing the Internet
Dimas [21]

This is an application

6 0
3 years ago
Write a program that reads a person's first and last names separated by a space, assuming the first and last names are both sing
Dmitriy789 [7]

<em>Complete Question:</em>

<em>Write a program that reads a person's first and last names, separated by a space. Then the program outputs last name, comma, first name. End with newline.  </em>

<em>Example output if the input is: Maya Jones </em>

<em>Jones, Maya</em>

<em></em>

<em>In C++</em>

<em></em>

Answer:

The program written in C++ is as follows

<em>#include<iostream></em>

<em>using namespace std;</em>

<em>int main(){</em>

<em>string lname, fname;</em>

<em>cout<<"First name: ";</em>

<em>cin>>fname;</em>

<em>cout<<"Last name: ";</em>

<em>cin>>lname;</em>

<em>cout<<lname<<", "<<fname;</em>

<em>return 0;</em>

<em>}</em>

<em />

Explanation:

This line declares lname, fname as string to get the user's last name and first name, respectively

<em>string lname, fname;</em>

This line prompts the user for first name

<em>cout<<"First name: ";</em>

This line gets the user first name

<em>cin>>fname;</em>

This line prompts the user for last name

<em>cout<<"Last name: ";</em>

This line gets the user last name

<em>cin>>lname;</em>

This line prints the desired output

<em>cout<<lname<<", "<<fname;</em>

7 0
3 years ago
Other questions:
  • One of the disadvantages of cable technology is that:
    7·1 answer
  • A user has been given Full Control permission to a shared folder. The user has been given Modify permission at the NTFS level to
    11·1 answer
  • The __________ vulnerability assessment is a process designed to find and document selected vulnerabilities that are likely to b
    15·1 answer
  • Which tool could be used to display only rows containing presidents who served two terms?
    8·2 answers
  • Which bus slot provides the highest video performance​
    8·1 answer
  • Retraining is required at intervals of ___ or less.
    10·1 answer
  • Jason Has A Science Video Project, As He Creats His Project, He Saves, Then Comes Back A Minute Later. The File Is Now Unreadabl
    8·2 answers
  • What is a credit card balance? A...The amount of interest you must pay the credit card company B...The required minimum payment
    15·1 answer
  • what is musical technology specifically, the origins of its genesis &amp; its importance to the baroque era
    6·1 answer
  • What is added to brining liquid to add flavour​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!