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
) What is the ""Phantom Inspector""? (
matrenka [14]

Answer:

 Phantom inspection is the process of finding various defects in the documents according to the . Basically, it is a group of meeting that usually provide the synergy effects and the maximum defects can easily be detected. This entire process is known as phantom inspector.  

It is also made some assumptions regarding the inspection that is made by one and more than one individual.

This process are usually done by inspecting the each operation output with the given output requirements.

4 0
2 years ago
To insert a new field in a table, the ____ keyword should be used with the alter table command
fenix001 [56]
It seems that you have missed the necessary options for us to answer this question so I had to look for it. Anyway here is the answer. To insert a new field in a table, the ADD <span>keyword should be used with the alter table command. Hope this answers your question.</span>
5 0
3 years ago
when you use an online mortgage calculator, normally you need to type in three items. which of the following is not one of these
STALIN [3.7K]
D) type of mortgage, as that is not neccessary to know.
5 0
3 years ago
Which category best represents: during class, students use their mobile phones to share answers to an assignment?
Studentka2010 [4]
The best category is cheating
5 0
3 years ago
Read 2 more answers
KSJEDHGYGVWJHMJ,RHGFYDOYWUGWHBJK
Sophie [7]

Answer:

hmmm this seems sophisticated.

Explanation:

4 0
2 years ago
Other questions:
  • Spreadshet formula to add totals​
    12·1 answer
  • The largest group of Linux users is likely to be
    7·1 answer
  • External hard disks use different technology than internal hard disks. ture or false
    6·1 answer
  • The ____ preceding a formula alerts excel that you are entering a formula or function and not text
    14·1 answer
  • Buenas , ayudenme con esta tarea de excel 2016
    6·1 answer
  • _____ is a systems development technique that produces a graphical representation of a concept or process that systems developer
    11·1 answer
  • Which wildcard characters will return a single character when using the Find dialog box?
    6·2 answers
  • Light is a key formal element that film artists and technicians carefully manipulate to create mood, reveal character, and conve
    15·1 answer
  • Choose the type of error described.
    12·1 answer
  • Give me facts on john john son
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!