The function to test for divisibilty by 3 will accept an input integers and divide it by three to check if its divisible by 3.
The function to test for divisiblity by 3 is as follows:
integer = input("input the integer to check if it's divisible by 3: ")
def reduce(integer):
list1 = []
sum1 = 0
for i in str(integer):
list1 += i
results = list(map(int, list1))
for x in results:
sum1 += x
if sum1 < 20 and sum1%3==0:
return "The integer is divisible by 3"
elif sum1 < 20 and sum1%3 != 0:
return "The integer is not divisible by 3"
else:
while sum1 >= 20:
z = sum(list(map(int, list(str(sum1)))))
if z%3==0:
return "The integer is divisible by 3"
else:
return "The integer is not divisible by 3"
print(reduce(integer))
<h3>Code explanation</h3>
- The integer variable stores the users input.
- We define a function called "reduce". The reduce function accepts the interger variable as a parameter.
- The code loop through the integer and check if it is divisible by 3.
- If the sum of the integer number is greater or equals to 20, we divide the resulting sum by 3 .
- If the integer is divisible by 3, we return "it is divisble by 3" and if it is not dividible by 3, it will return "it is not divisble by 3".
learn more on python here: brainly.com/question/13437928
Smtp : Simple Mail Transfer Protocol
Answer:
The answer to this question is "Incrementing".
Explanation:
In this question the answer is Incrementing because When we declare the for loop it takes three things that can be explained by following syntax that can be given as:
Syntax:
for ( initialization; condition checking; increment or decrements )
{
statements
}
In the initialization, we initialize(starting) value. In the condition checking, we check the condition that value is not above the condition value. Then we increment or decrements the value. In the loop, it controls variable value and alter value by increment or add to them.
The answer to the above question is:
d. all of the above
Answer:
White spirit (UK) or mineral spirits (US, Canada), also known as mineral turpentine (AU/NZ), turpentine substitute, and petroleum spirits, is a petroleum-derived clear liquid used as a common organic solvent in painting.