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 area located at the top of the word screen includes home , insert , and page layout ?
Misha Larkins [42]

Answer:

Whats your qeustion

Explanation:

4 0
3 years ago
Read 2 more answers
The _____ option will require users to have a password to access the document.
Zepler [3.9K]
The login option will require users to have to have a password to access the document
6 0
3 years ago
Read 2 more answers
What do virtually all "phishing" emails have in common?
Arisa [49]
The name of your email/or dont have any name, asking for money, spelling mistakes, and sometimes a UNSUBSCRIBE button at the bottom of the email.
6 0
3 years ago
Siltstone is made mostly of _____.<br><br> A : silt<br> B : sand<br> C : shells<br> D : gravel
frez [133]
The best and most correct answer among the choices provided by the question is the second choice. <span>Siltstone is made mostly of silt. </span>I hope my answer has come to your help. God bless and have a nice day ahead!
6 0
3 years ago
Read 2 more answers
If you created a variable called name, what data type would that value be?
garik1379 [7]

Answer:

a string

Explanation:

bcz that's the only answer

3 0
3 years ago
Read 2 more answers
Other questions:
  • What are the 4-bit patterns used to represent each of the characters in the string "1301"? Only represent the characters between
    14·1 answer
  • Which sentences in the passage correctly describe a function?
    11·1 answer
  • Which of these sites would need additional investigation to check for reliability?
    8·2 answers
  • Purpose Your goal is to create a design for a software interface. You will experience the scope of the design process from brain
    7·1 answer
  • 5. RAM IS YOUR SYSTEM’S-
    14·2 answers
  • According to the Computing Research Association, the number of undergraduate degrees awarded in computer science at doctoral-gra
    11·1 answer
  • Ted has $55.00 in his pocket. Which purchase will he be able to pay for with cash?
    9·2 answers
  • An online service allows users to integrate their phonebook with their social media profiles and stores it on the cloud. The pho
    12·1 answer
  • Any device that uses light to read and write information.
    9·2 answers
  • What company was affected by the cloudbleed vulnerability?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!