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
d1i1m1o1n [39]
3 years ago
11

A. Write a program that asks the user to enter an integer, then prints a list of all positive integers that divide that number e

venly, excluding 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:
2
3
4
6
b. The file must be named: factors.py
c. Code must be written in python, not C++ or Java
Computers and Technology
1 answer:
kobusy [5.1K]3 years ago
4 0

Answer:

Following are the program in python language the name of the program is factors.py

num= int(input("Please enter a positive integer: "))#Read the number by user

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

for k in range(2,num): #iterating over the loop

   if(num%k==0): #checking the condition

       print(k)#display the factor

Output:

Please enter a positive integer: 12

The factors of 12 are:

2

3

4

6      

Explanation:

Following are the description of the program

  • Read the number by user in the "num" variable
  • Iterating the for loop from k=2 to less then "num".
  • In the for loop checking the factor of "num"  variable by using % operator.
  • Finally display the factor by using print function
You might be interested in
The ____, or typeface, defines the appearance and shape of letters, numbers, and special characters.
Paladinen [302]
Font(s)
fonts is another word for typeface
the appearance of letters and numbers when you chang the font
5 0
3 years ago
Edhisive 3.5 code practice
Amanda [17]

Answer:

x = int(input("What grade are you in? "))

if (x == 9):

   print ("Freshman")

elif (x == 10):

   print("Sophomore")

elif (x == 11):

   print ("Junior")

elif (x == 12):

   print("Senior")

else:

   print ("Not in High School")

Explanation:

7 0
2 years ago
The marketing company era marks the time when companies realized they needed to switch from just trying to sell
djverab [1.8K]

Answer:

False

Explanation:

I hope this is right

7 0
2 years ago
Date Time Manipulation Exploration If you start from Jan 1st, 1757, and repeatedly add 8 days, until you hit 1800, how many time
zimovet [89]

Answer:

from datetime import datetime, date, timedelta

def count_weekdays(start_date, add_days, stop_year, weekday):

   my_date = start_date

   m = 0  

   while my_date.year != stop_year:  

       my_date = my_date + timedelta(days = add_days)

       if my_date.isoweekday() == weekday:

           m += 1

   return m

date_val = date(1757,1,1)

try:

   date_val = datetime.fromisoformat(input("Enter date in the format yyyy-mm-dd: "))

except ValueError:

   print("Wrong isoformat string")

print(count_weekdays(date_val, 8, 1800, 1))

Explanation:

The datetime package of the python programming language has several time modules like the date, datetime, pytz, timedelta, etc, used to manipulate date and time in documents. The function count_weekdays has four parameters and returns the number of a specified weekday in a period of time.

4 0
3 years ago
Select the images that are isometric drawings
valkas [14]

Answer:

There’s no images

Explanation:

7 0
2 years ago
Other questions:
  • Web browsers are used to browse the world wide web.
    5·2 answers
  • ( Game Design) The companies who get video games out to consumers are called:
    12·1 answer
  • Question 2 of 5
    8·1 answer
  • A storyboard is an example of an implementation tool.
    8·1 answer
  • It is possible to limit the search results to a range of publication dates.
    13·1 answer
  • Memory cache is referred to as ______. A. SRAM c. SROM b. DRAM d. DROM
    11·1 answer
  • Ten examples of an interpreter
    8·1 answer
  • How is knowing how to use word or docs importamt?
    8·1 answer
  • The memory used by the CPU to temporarily hold data while processing is called _______. random access memory central processing
    5·1 answer
  • How to test someone elese internet speed from a distance
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!