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
Rudik [331]
3 years ago
6

write a program that asks the user to enter a positive integer, then prints a list of all positive integers that divide that num

ber evenly, including itself and 1, in ascending order. when you run your program, it should match the following format: please enter a positive integer: 12 the factors of 12 are: 1 2 3 4 6 12 the file must be named: factors.py
Computers and Technology
1 answer:
Stolb23 [73]3 years ago
3 0

Answer:

<em>The program is written using python</em>

<em>See explanation section for detailed explanation; as the program does not accommodate comments.</em>

<em>Program starts here</em>

num = int(input("please enter a positive integer: "))

print("The factors of",num,"are:")

for i in range(1, num + 1):

    if num % i == 0:

         print(i)

Explanation:

This line prompts the user for input

num = int(input("please enter a positive integer: "))

This line prints a string literal which states the factors of the input number

print("The factors of",num,"are:")

The next line is a for statement that iterates all positive numbers from 1 till the inputted number

for i in range(1, num + 1):

This next line checks for the factors of the user input by checking for remainders.

    if num % i == 0:

Lastly, the factors are printed

         print(i)

You might be interested in
Which framework can be used to develop cross-platform applications?
k0ka [10]

Answer:

Qt framework

Explanation:

3 0
3 years ago
If you were an architect planning on building a large scale Municipal complex what type of engineer would you identify as essent
Daniel [21]

Answer: civil engineer

Explanation:

Based on the information given, the type of engineer that would be identified as essential to the success of the project would be the civil engineer.

Civil engineers are the engineers that are in charge of the planning and overseeing building and infrastructure construction. They plan and monitor constructions involving bridges, road, houses, power plants etc.

3 0
3 years ago
How can financial planning help you plan for your future education
Andrews [41]
It helps you in future times. For school work,you have to be ready.
6 0
4 years ago
Types of email resources. Examples
denis23 [38]
Newsletter emails
Milestone emails
Welcome emails
Review request emails

Hope this helps!
8 0
3 years ago
CORRECT ANSWER GETS BRAINLIEST PLEASE HELP !
KIM [24]

Answer:

Mediator

Explanation:

A mediator is a person that tries to reserve peace within groups, and they often try to prevent conflict.

4 0
3 years ago
Other questions:
  • An archive of files that usually contain scripts that install the software contents to the correct location on the system is ref
    11·1 answer
  • Write a program in C which will open a text file named Story.txt. You can create the file using any text editor like notepad etc
    9·1 answer
  • Which organization safeguards americans from health, safety, and security hazards and threats?
    14·2 answers
  • Are headphones considered a computer? Why or why not?
    13·2 answers
  • Which of the example DFSs discussed in this chapter would handle a large, multiclient database application most efficiently? Exp
    14·1 answer
  • A network consists of 10 computers, all running windows 7 professional. one computer acts as a file server and serves up data to
    6·1 answer
  • What are the elements of a good study environment? Check all that apply.
    9·2 answers
  • You are a running cable in a new network. You are running a series of cables from the wiring closet to the RJ-45 ports for the c
    6·1 answer
  • Free up disk space by doing____?​
    6·2 answers
  • How has 5G become more energy efficient?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!