SlideShare a Scribd company logo
In Python,
Create a program that asks the user for a number and then prints out a list of all the divisors of
that number. (If you don't remember divisor is a number that divides into another without a
remainder. For example, 13 is a divisor of 26 because 26/13 has no remainder.)
Solution
n = int(input("Enter a number: "))
list1 = []
for i in range(1, int(n/2)+1, +1):
if n % i == 0:
list1.append(i)
print list1
Output:
sh-4.3$ python
main.py
Enter a number:
26
[1, 2,
13]
sh-4.3$ python
main.py
Enter a number:
50
[1, 2, 5, 10, 25]
Ad

More Related Content

More from ebrahimbadushata00 (20)

Explain why owners equity includes common stock as a liability eve.pdf
Explain why owners equity includes common stock as a liability eve.pdfExplain why owners equity includes common stock as a liability eve.pdf
Explain why owners equity includes common stock as a liability eve.pdf
ebrahimbadushata00
 
Evaluate the statements below and determine which is the best reason.pdf
Evaluate the statements below and determine which is the best reason.pdfEvaluate the statements below and determine which is the best reason.pdf
Evaluate the statements below and determine which is the best reason.pdf
ebrahimbadushata00
 
Discuss the Economic Benefits from Immigration.SolutionImmigra.pdf
Discuss the Economic Benefits from Immigration.SolutionImmigra.pdfDiscuss the Economic Benefits from Immigration.SolutionImmigra.pdf
Discuss the Economic Benefits from Immigration.SolutionImmigra.pdf
ebrahimbadushata00
 
Conclusion Phases of Oxidative Phosphorylation Focus your attention.pdf
Conclusion Phases of Oxidative Phosphorylation  Focus your attention.pdfConclusion Phases of Oxidative Phosphorylation  Focus your attention.pdf
Conclusion Phases of Oxidative Phosphorylation Focus your attention.pdf
ebrahimbadushata00
 
Computer Forensics Process Please respond to the followingThe.pdf
Computer Forensics Process Please respond to the followingThe.pdfComputer Forensics Process Please respond to the followingThe.pdf
Computer Forensics Process Please respond to the followingThe.pdf
ebrahimbadushata00
 
ArticleHinduism and Caste Systemby Jayaram VHinduism is a univ.pdf
ArticleHinduism and Caste Systemby Jayaram VHinduism is a univ.pdfArticleHinduism and Caste Systemby Jayaram VHinduism is a univ.pdf
ArticleHinduism and Caste Systemby Jayaram VHinduism is a univ.pdf
ebrahimbadushata00
 
Can someone solveexplain this I thought I was understanding this, .pdf
Can someone solveexplain this I thought I was understanding this, .pdfCan someone solveexplain this I thought I was understanding this, .pdf
Can someone solveexplain this I thought I was understanding this, .pdf
ebrahimbadushata00
 
C The ame compound componda with F Souls . E Difluut eoupou ds with.pdf
C The ame compound componda with F Souls . E  Difluut eoupou ds with.pdfC The ame compound componda with F Souls . E  Difluut eoupou ds with.pdf
C The ame compound componda with F Souls . E Difluut eoupou ds with.pdf
ebrahimbadushata00
 
Background Sometimes the standard C libraries (stdio.h, stdlib.h, e.pdf
Background Sometimes the standard C libraries (stdio.h, stdlib.h, e.pdfBackground Sometimes the standard C libraries (stdio.h, stdlib.h, e.pdf
Background Sometimes the standard C libraries (stdio.h, stdlib.h, e.pdf
ebrahimbadushata00
 
a. Modify the C program ex.9 so that it simulates the Unix pipe comm.pdf
a. Modify the C program ex.9 so that it simulates the Unix pipe comm.pdfa. Modify the C program ex.9 so that it simulates the Unix pipe comm.pdf
a. Modify the C program ex.9 so that it simulates the Unix pipe comm.pdf
ebrahimbadushata00
 
A severe B12 deficiency can cause megaloblastic anemia but in severe .pdf
A severe B12 deficiency can cause megaloblastic anemia but in severe .pdfA severe B12 deficiency can cause megaloblastic anemia but in severe .pdf
A severe B12 deficiency can cause megaloblastic anemia but in severe .pdf
ebrahimbadushata00
 
When you are admitted to the hospital for surgery, you are very ofte.pdf
When you are admitted to the hospital for surgery, you are very ofte.pdfWhen you are admitted to the hospital for surgery, you are very ofte.pdf
When you are admitted to the hospital for surgery, you are very ofte.pdf
ebrahimbadushata00
 
Write a java class LIST that outputsmainpublic class Ass.pdf
Write a java class LIST that outputsmainpublic class Ass.pdfWrite a java class LIST that outputsmainpublic class Ass.pdf
Write a java class LIST that outputsmainpublic class Ass.pdf
ebrahimbadushata00
 
Why is being ethnically diverse is greatSolutionEthnic divers.pdf
Why is being ethnically diverse is greatSolutionEthnic divers.pdfWhy is being ethnically diverse is greatSolutionEthnic divers.pdf
Why is being ethnically diverse is greatSolutionEthnic divers.pdf
ebrahimbadushata00
 
Which phase of SDLC is testing conducted What is the difference bet.pdf
Which phase of SDLC is testing conducted What is the difference bet.pdfWhich phase of SDLC is testing conducted What is the difference bet.pdf
Which phase of SDLC is testing conducted What is the difference bet.pdf
ebrahimbadushata00
 
Which of the following aromatic rings IS alkylated most rapidly by ch.pdf
Which of the following aromatic rings IS alkylated most rapidly by ch.pdfWhich of the following aromatic rings IS alkylated most rapidly by ch.pdf
Which of the following aromatic rings IS alkylated most rapidly by ch.pdf
ebrahimbadushata00
 
11. Describe rational for income redistributionSolutionThe rea.pdf
11. Describe rational for income redistributionSolutionThe rea.pdf11. Describe rational for income redistributionSolutionThe rea.pdf
11. Describe rational for income redistributionSolutionThe rea.pdf
ebrahimbadushata00
 
What do we lose, and what do we gain, by using general terms such as.pdf
What do we lose, and what do we gain, by using general terms such as.pdfWhat do we lose, and what do we gain, by using general terms such as.pdf
What do we lose, and what do we gain, by using general terms such as.pdf
ebrahimbadushata00
 
What are the three (3) most common reasons for corporations to make .pdf
What are the three (3) most common reasons for corporations to make .pdfWhat are the three (3) most common reasons for corporations to make .pdf
What are the three (3) most common reasons for corporations to make .pdf
ebrahimbadushata00
 
the process of invasion by malignant cells is dependent ona. activ.pdf
the process of invasion by malignant cells is dependent ona. activ.pdfthe process of invasion by malignant cells is dependent ona. activ.pdf
the process of invasion by malignant cells is dependent ona. activ.pdf
ebrahimbadushata00
 
Explain why owners equity includes common stock as a liability eve.pdf
Explain why owners equity includes common stock as a liability eve.pdfExplain why owners equity includes common stock as a liability eve.pdf
Explain why owners equity includes common stock as a liability eve.pdf
ebrahimbadushata00
 
Evaluate the statements below and determine which is the best reason.pdf
Evaluate the statements below and determine which is the best reason.pdfEvaluate the statements below and determine which is the best reason.pdf
Evaluate the statements below and determine which is the best reason.pdf
ebrahimbadushata00
 
Discuss the Economic Benefits from Immigration.SolutionImmigra.pdf
Discuss the Economic Benefits from Immigration.SolutionImmigra.pdfDiscuss the Economic Benefits from Immigration.SolutionImmigra.pdf
Discuss the Economic Benefits from Immigration.SolutionImmigra.pdf
ebrahimbadushata00
 
Conclusion Phases of Oxidative Phosphorylation Focus your attention.pdf
Conclusion Phases of Oxidative Phosphorylation  Focus your attention.pdfConclusion Phases of Oxidative Phosphorylation  Focus your attention.pdf
Conclusion Phases of Oxidative Phosphorylation Focus your attention.pdf
ebrahimbadushata00
 
Computer Forensics Process Please respond to the followingThe.pdf
Computer Forensics Process Please respond to the followingThe.pdfComputer Forensics Process Please respond to the followingThe.pdf
Computer Forensics Process Please respond to the followingThe.pdf
ebrahimbadushata00
 
ArticleHinduism and Caste Systemby Jayaram VHinduism is a univ.pdf
ArticleHinduism and Caste Systemby Jayaram VHinduism is a univ.pdfArticleHinduism and Caste Systemby Jayaram VHinduism is a univ.pdf
ArticleHinduism and Caste Systemby Jayaram VHinduism is a univ.pdf
ebrahimbadushata00
 
Can someone solveexplain this I thought I was understanding this, .pdf
Can someone solveexplain this I thought I was understanding this, .pdfCan someone solveexplain this I thought I was understanding this, .pdf
Can someone solveexplain this I thought I was understanding this, .pdf
ebrahimbadushata00
 
C The ame compound componda with F Souls . E Difluut eoupou ds with.pdf
C The ame compound componda with F Souls . E  Difluut eoupou ds with.pdfC The ame compound componda with F Souls . E  Difluut eoupou ds with.pdf
C The ame compound componda with F Souls . E Difluut eoupou ds with.pdf
ebrahimbadushata00
 
Background Sometimes the standard C libraries (stdio.h, stdlib.h, e.pdf
Background Sometimes the standard C libraries (stdio.h, stdlib.h, e.pdfBackground Sometimes the standard C libraries (stdio.h, stdlib.h, e.pdf
Background Sometimes the standard C libraries (stdio.h, stdlib.h, e.pdf
ebrahimbadushata00
 
a. Modify the C program ex.9 so that it simulates the Unix pipe comm.pdf
a. Modify the C program ex.9 so that it simulates the Unix pipe comm.pdfa. Modify the C program ex.9 so that it simulates the Unix pipe comm.pdf
a. Modify the C program ex.9 so that it simulates the Unix pipe comm.pdf
ebrahimbadushata00
 
A severe B12 deficiency can cause megaloblastic anemia but in severe .pdf
A severe B12 deficiency can cause megaloblastic anemia but in severe .pdfA severe B12 deficiency can cause megaloblastic anemia but in severe .pdf
A severe B12 deficiency can cause megaloblastic anemia but in severe .pdf
ebrahimbadushata00
 
When you are admitted to the hospital for surgery, you are very ofte.pdf
When you are admitted to the hospital for surgery, you are very ofte.pdfWhen you are admitted to the hospital for surgery, you are very ofte.pdf
When you are admitted to the hospital for surgery, you are very ofte.pdf
ebrahimbadushata00
 
Write a java class LIST that outputsmainpublic class Ass.pdf
Write a java class LIST that outputsmainpublic class Ass.pdfWrite a java class LIST that outputsmainpublic class Ass.pdf
Write a java class LIST that outputsmainpublic class Ass.pdf
ebrahimbadushata00
 
Why is being ethnically diverse is greatSolutionEthnic divers.pdf
Why is being ethnically diverse is greatSolutionEthnic divers.pdfWhy is being ethnically diverse is greatSolutionEthnic divers.pdf
Why is being ethnically diverse is greatSolutionEthnic divers.pdf
ebrahimbadushata00
 
Which phase of SDLC is testing conducted What is the difference bet.pdf
Which phase of SDLC is testing conducted What is the difference bet.pdfWhich phase of SDLC is testing conducted What is the difference bet.pdf
Which phase of SDLC is testing conducted What is the difference bet.pdf
ebrahimbadushata00
 
Which of the following aromatic rings IS alkylated most rapidly by ch.pdf
Which of the following aromatic rings IS alkylated most rapidly by ch.pdfWhich of the following aromatic rings IS alkylated most rapidly by ch.pdf
Which of the following aromatic rings IS alkylated most rapidly by ch.pdf
ebrahimbadushata00
 
11. Describe rational for income redistributionSolutionThe rea.pdf
11. Describe rational for income redistributionSolutionThe rea.pdf11. Describe rational for income redistributionSolutionThe rea.pdf
11. Describe rational for income redistributionSolutionThe rea.pdf
ebrahimbadushata00
 
What do we lose, and what do we gain, by using general terms such as.pdf
What do we lose, and what do we gain, by using general terms such as.pdfWhat do we lose, and what do we gain, by using general terms such as.pdf
What do we lose, and what do we gain, by using general terms such as.pdf
ebrahimbadushata00
 
What are the three (3) most common reasons for corporations to make .pdf
What are the three (3) most common reasons for corporations to make .pdfWhat are the three (3) most common reasons for corporations to make .pdf
What are the three (3) most common reasons for corporations to make .pdf
ebrahimbadushata00
 
the process of invasion by malignant cells is dependent ona. activ.pdf
the process of invasion by malignant cells is dependent ona. activ.pdfthe process of invasion by malignant cells is dependent ona. activ.pdf
the process of invasion by malignant cells is dependent ona. activ.pdf
ebrahimbadushata00
 

Recently uploaded (20)

puzzle Irregular Verbs- Simple Past Tense
puzzle Irregular Verbs- Simple Past Tensepuzzle Irregular Verbs- Simple Past Tense
puzzle Irregular Verbs- Simple Past Tense
OlgaLeonorTorresSnch
 
Cultivation Practice of Turmeric in Nepal.pptx
Cultivation Practice of Turmeric in Nepal.pptxCultivation Practice of Turmeric in Nepal.pptx
Cultivation Practice of Turmeric in Nepal.pptx
UmeshTimilsina1
 
Transform tomorrow: Master benefits analysis with Gen AI today webinar, 30 A...
Transform tomorrow: Master benefits analysis with Gen AI today webinar,  30 A...Transform tomorrow: Master benefits analysis with Gen AI today webinar,  30 A...
Transform tomorrow: Master benefits analysis with Gen AI today webinar, 30 A...
Association for Project Management
 
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
Celine George
 
Myopathies (muscle disorders) for undergraduate
Myopathies (muscle disorders) for undergraduateMyopathies (muscle disorders) for undergraduate
Myopathies (muscle disorders) for undergraduate
Mohamed Rizk Khodair
 
Cultivation Practice of Onion in Nepal.pptx
Cultivation Practice of Onion in Nepal.pptxCultivation Practice of Onion in Nepal.pptx
Cultivation Practice of Onion in Nepal.pptx
UmeshTimilsina1
 
MEDICAL BIOLOGY MCQS BY. DR NASIR MUSTAFA
MEDICAL BIOLOGY MCQS  BY. DR NASIR MUSTAFAMEDICAL BIOLOGY MCQS  BY. DR NASIR MUSTAFA
MEDICAL BIOLOGY MCQS BY. DR NASIR MUSTAFA
Dr. Nasir Mustafa
 
antiquity of writing in ancient India- literary & archaeological evidence
antiquity of writing in ancient India- literary & archaeological evidenceantiquity of writing in ancient India- literary & archaeological evidence
antiquity of writing in ancient India- literary & archaeological evidence
PrachiSontakke5
 
Ajanta Paintings: Study as a Source of History
Ajanta Paintings: Study as a Source of HistoryAjanta Paintings: Study as a Source of History
Ajanta Paintings: Study as a Source of History
Virag Sontakke
 
CNS infections (encephalitis, meningitis & Brain abscess
CNS infections (encephalitis, meningitis & Brain abscessCNS infections (encephalitis, meningitis & Brain abscess
CNS infections (encephalitis, meningitis & Brain abscess
Mohamed Rizk Khodair
 
ANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptx
ANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptxANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptx
ANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptx
Mayuri Chavan
 
Myasthenia gravis (Neuromuscular disorder)
Myasthenia gravis (Neuromuscular disorder)Myasthenia gravis (Neuromuscular disorder)
Myasthenia gravis (Neuromuscular disorder)
Mohamed Rizk Khodair
 
E-Filing_of_Income_Tax.pptx and concept of form 26AS
E-Filing_of_Income_Tax.pptx and concept of form 26ASE-Filing_of_Income_Tax.pptx and concept of form 26AS
E-Filing_of_Income_Tax.pptx and concept of form 26AS
Abinash Palangdar
 
Botany Assignment Help Guide - Academic Excellence
Botany Assignment Help Guide - Academic ExcellenceBotany Assignment Help Guide - Academic Excellence
Botany Assignment Help Guide - Academic Excellence
online college homework help
 
UPMVLE migration to ARAL. A step- by- step guide
UPMVLE migration to ARAL. A step- by- step guideUPMVLE migration to ARAL. A step- by- step guide
UPMVLE migration to ARAL. A step- by- step guide
abmerca
 
Chemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptxChemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptx
Mayuri Chavan
 
How To Maximize Sales Performance using Odoo 18 Diverse views in sales module
How To Maximize Sales Performance using Odoo 18 Diverse views in sales moduleHow To Maximize Sales Performance using Odoo 18 Diverse views in sales module
How To Maximize Sales Performance using Odoo 18 Diverse views in sales module
Celine George
 
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon DolabaniHistory Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
fruinkamel7m
 
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
parmarjuli1412
 
Ancient Stone Sculptures of India: As a Source of Indian History
Ancient Stone Sculptures of India: As a Source of Indian HistoryAncient Stone Sculptures of India: As a Source of Indian History
Ancient Stone Sculptures of India: As a Source of Indian History
Virag Sontakke
 
puzzle Irregular Verbs- Simple Past Tense
puzzle Irregular Verbs- Simple Past Tensepuzzle Irregular Verbs- Simple Past Tense
puzzle Irregular Verbs- Simple Past Tense
OlgaLeonorTorresSnch
 
Cultivation Practice of Turmeric in Nepal.pptx
Cultivation Practice of Turmeric in Nepal.pptxCultivation Practice of Turmeric in Nepal.pptx
Cultivation Practice of Turmeric in Nepal.pptx
UmeshTimilsina1
 
Transform tomorrow: Master benefits analysis with Gen AI today webinar, 30 A...
Transform tomorrow: Master benefits analysis with Gen AI today webinar,  30 A...Transform tomorrow: Master benefits analysis with Gen AI today webinar,  30 A...
Transform tomorrow: Master benefits analysis with Gen AI today webinar, 30 A...
Association for Project Management
 
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
Celine George
 
Myopathies (muscle disorders) for undergraduate
Myopathies (muscle disorders) for undergraduateMyopathies (muscle disorders) for undergraduate
Myopathies (muscle disorders) for undergraduate
Mohamed Rizk Khodair
 
Cultivation Practice of Onion in Nepal.pptx
Cultivation Practice of Onion in Nepal.pptxCultivation Practice of Onion in Nepal.pptx
Cultivation Practice of Onion in Nepal.pptx
UmeshTimilsina1
 
MEDICAL BIOLOGY MCQS BY. DR NASIR MUSTAFA
MEDICAL BIOLOGY MCQS  BY. DR NASIR MUSTAFAMEDICAL BIOLOGY MCQS  BY. DR NASIR MUSTAFA
MEDICAL BIOLOGY MCQS BY. DR NASIR MUSTAFA
Dr. Nasir Mustafa
 
antiquity of writing in ancient India- literary & archaeological evidence
antiquity of writing in ancient India- literary & archaeological evidenceantiquity of writing in ancient India- literary & archaeological evidence
antiquity of writing in ancient India- literary & archaeological evidence
PrachiSontakke5
 
Ajanta Paintings: Study as a Source of History
Ajanta Paintings: Study as a Source of HistoryAjanta Paintings: Study as a Source of History
Ajanta Paintings: Study as a Source of History
Virag Sontakke
 
CNS infections (encephalitis, meningitis & Brain abscess
CNS infections (encephalitis, meningitis & Brain abscessCNS infections (encephalitis, meningitis & Brain abscess
CNS infections (encephalitis, meningitis & Brain abscess
Mohamed Rizk Khodair
 
ANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptx
ANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptxANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptx
ANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptx
Mayuri Chavan
 
Myasthenia gravis (Neuromuscular disorder)
Myasthenia gravis (Neuromuscular disorder)Myasthenia gravis (Neuromuscular disorder)
Myasthenia gravis (Neuromuscular disorder)
Mohamed Rizk Khodair
 
E-Filing_of_Income_Tax.pptx and concept of form 26AS
E-Filing_of_Income_Tax.pptx and concept of form 26ASE-Filing_of_Income_Tax.pptx and concept of form 26AS
E-Filing_of_Income_Tax.pptx and concept of form 26AS
Abinash Palangdar
 
Botany Assignment Help Guide - Academic Excellence
Botany Assignment Help Guide - Academic ExcellenceBotany Assignment Help Guide - Academic Excellence
Botany Assignment Help Guide - Academic Excellence
online college homework help
 
UPMVLE migration to ARAL. A step- by- step guide
UPMVLE migration to ARAL. A step- by- step guideUPMVLE migration to ARAL. A step- by- step guide
UPMVLE migration to ARAL. A step- by- step guide
abmerca
 
Chemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptxChemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptx
Mayuri Chavan
 
How To Maximize Sales Performance using Odoo 18 Diverse views in sales module
How To Maximize Sales Performance using Odoo 18 Diverse views in sales moduleHow To Maximize Sales Performance using Odoo 18 Diverse views in sales module
How To Maximize Sales Performance using Odoo 18 Diverse views in sales module
Celine George
 
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon DolabaniHistory Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
fruinkamel7m
 
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
parmarjuli1412
 
Ancient Stone Sculptures of India: As a Source of Indian History
Ancient Stone Sculptures of India: As a Source of Indian HistoryAncient Stone Sculptures of India: As a Source of Indian History
Ancient Stone Sculptures of India: As a Source of Indian History
Virag Sontakke
 
Ad

In Python,Create a program that asks the user for a number and the.pdf

  • 1. In Python, Create a program that asks the user for a number and then prints out a list of all the divisors of that number. (If you don't remember divisor is a number that divides into another without a remainder. For example, 13 is a divisor of 26 because 26/13 has no remainder.) Solution n = int(input("Enter a number: ")) list1 = [] for i in range(1, int(n/2)+1, +1): if n % i == 0: list1.append(i) print list1 Output: sh-4.3$ python main.py Enter a number: 26 [1, 2, 13] sh-4.3$ python main.py Enter a number: 50 [1, 2, 5, 10, 25]
  翻译: