Add your headings in the row of cells at the top of the sheet
Answer:
def display_factors(num):
for counter in range(1, num+1):
if num % counter == 0:
print(counter)
int_num= int(input("Enter a number : "))
print("The factors for {} are : ".format(int_num))
display_factors(int_num)
Explanation:
The function display_factors is used to display all factors of a number entered by a user.
- In this for counter in range(1, num+1) the for loop is iterated until counter is greater to num is false. Counter variable starts from 1 and ends when it gets greater than the input number.
- if num % counter == 0: In this statement, each loop iteration, checks whether a number (num) is exactly divisible by counter. It is the condition for counter to be a factor of num.
- print(counter) This is used to display factors of an input number
- int_num= int(input("Enter a number : ")) This statement asks user to enter a number (int_num) which will be an integer.
- display_factors(int_num) This calls display_factors number to find the factors of an input number.
Answer with Explanation:
I would forego the all-day basketball tournament because, clearly, I will be spending so much for just a one-day fun. I'm sure there will be other upcoming basketball tournaments I can attend to. So, I will accept my neighbor's offer of helping to paint their apartment because <em><u>I will be earning $75 and such offer doesn't come every day.</u></em> Since I also want to enjoy and hang out with friends, I would call a friend to help me in painting the apartment so we could split the payment, which means<u> both of us will have</u><u><em> $37.5</em></u><u>.</u> In this case, <u>I will not only earn money on Saturday but will also get to enjoy the company of my friend.</u>