answer.
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
GrogVix
18 days ago
13

Factoring of integers. Write a python program that asks the user for an integer and then prints out all its factors. For example

, when the user enters 150, the program should print 2 3 5 5.
This is just a pseudocode for visual:
Get a value from user Print
"The factors are: "
Keep going while the value is greater than 1
Start the divisor at 2 A factor has not been found Keep going until a factor is found
If the value is evenly divisible by the divisor
A factor has been found
Print the divisor Change value to equal value / divisor.
You have now found a factor you want to see if there are factors in the remaining part of the number.
FYI: For instance if the number is 100, your first factor would be 2 and on our second time through you would need to see if there are factors of 50. This would result in another factor of 2 in the third pass and looking for factors of 25. This would result in a factor of 5 in the fourth pass and looking for factors of 5. This would result in value finally = 1 so you are done. If I enter 175, I would see 5, 5, and 7 as my results. Increment the divisor so you can see if the next number is a factor. This statement is not necessary if a factor is found, but it does not matter if it is executed because you will fall out of the inside nested if and reset the divisor to 2 if you come back in.
Computers and Technology
1 answer:
Rzqust [894]18 days ago
8 0
num = int(input("Enter a number: ")) i = 2 while num > 1: if num % i == 0: num = num / i print(i, end=" ") i = 2 i += 1 I hope this information is helpful!
You might be interested in
Disk scheduling algorithms in operating systems consider only seek distances, because Select one: a. modern disks do not disclos
amid [800]

Response:

a. Current disks do not reveal the actual locations of logical blocks.

Clarification:

Modern disks incorporate scheduling algorithms within the disk drive itself. This presents challenges for operating systems trying to optimize rotational latency. All scheduling methods end up having to perform similarly due to potential constraints faced by the operating system. Disks are typically accessed in physical blocks. Modern technology applies more electronic control to the disk.

4 0
13 days ago
8. In time series, which of the following cannot be predicted? A) large increases in demand B) technological trends C) seasonal
Natasha_Volkova [897]

Answer: Random fluctuations.

Explanation: A time series consists of data points ordered chronologically, arranged in equal intervals. Typically, this data sequence is systematic and has defined intervals. However, there’s no allowance for randomness, making unpredictable variations, or random fluctuations, absent in such series. Thus, option (D) is the correct choice.

6 0
1 month ago
Which of the following describes ETL? a) A process that transforms information using a common set of enterprise definitions b) A
zubka84 [942]

Answer:

The right choice is d) All of these options are accurate.

Explanation:

ETL refers to Extract, Transform, and Load. An ETL framework retrieves data from various sources, upholds standards for data quality and consistency, standardizes data so disparate sources can be integrated, and ultimately presents the data in formats suitable for application development and decision-making by end-users.

4 0
1 month ago
Sean is white hat hacker, who is demonstrating a network level session hijack attacks and as part of it, he has injected malicio
amid [800]

Answer:

The type of session hijacking attack that Sean is illustrating is Blind Hijacking, option C.

Explanation:

This is because he is inserting harmful data or commands into the compromised communications within the TCP session, regardless of the source-routing being turned off. He is capable of sending the data or commands, but does not have the ability to view the responses.

3 0
8 days ago
Someone else can drive your car if _____.
8_murik_8 [892]

Answer:

C. you possess insurance documentation

Explanation:

Being a resident does not automatically grant permission to operate a vehicle. For instance, a person might have residency but might also have a suspended license, which means they are unable to drive.

Typically, insurance applies to the CAR rather than the individual. Therefore, the general guideline is:

A different person is permitted to drive your vehicle if you possess proof of insurance.

6 0
27 days ago
Read 2 more answers
Other questions:
  • In what areas is Leslie's underspending hurting her budget select all that apply
    5·1 answer
  • Sites like Zillow get input about house prices from a database and provide nice summaries for readers. Write a program with two
    12·1 answer
  • Write a statement that reads a floating point value from standard input into temperature. Assume that temperature. has already b
    6·1 answer
  • Charlie has a large book collection. He was keeping track of it in a spreadsheet, but it has grown big enough that he wants to c
    10·1 answer
  • PLEASE HELP!!~~
    7·1 answer
  • A company decides to relocate its operations to another state in order to take advantage of some new business investment credits
    15·1 answer
  • 5.15 LAB: Output values below an amount Write a program that first gets a list of integers from input. The input begins with an
    9·2 answers
  • explain why entrepreneurial activities are important to social development and progress of the econo​
    9·1 answer
  • Redo Programming Exercise 16 of Chapter 4 so that all the named constants are defined in a namespace royaltyRates. PLEASE DONT F
    14·1 answer
  • Suppose that a 10-Mbps wireless station is transmitting 50-byte frames one immediately after the other.
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!