IDNLearn.com makes it easy to find accurate answers to your specific questions. Our platform is designed to provide reliable and thorough answers to all your questions, no matter the topic.
Assignment 4 divisible by three
I need a little help. I do not understand what I am doing wrong. I keep getting this message in the picture included.
n = int(input("How many numbers do you need to check? "))
divisible = 0
notdivisible = 0
for x in range(n):
num = int(input("Enter number: "))
if num % 3== 0:
divisible += 1
print(str(num)+" is divisible by 3.")
else:
num % 3== 0
notdivisible += 1
print(str(num)+" is not divisible by 3.")
print("You entered "+str(divisible )+" number(s) that are divisible by 3.")
print("You entered "+str(notdivisible )+" number(s) that are not divisible by 3.")
n = int(input("How many numbers do you need to check? "))
divisible = 0
notdivisible = 0
for x in range(n):
num = int(input("Enter number: "))
if num % 3== 0:
divisible += 1
print(str(num)+" is divisible by 3.")
else:
num % 3== 0
notdivisible += 1
print(str(num)+" is not divisible by 3.")
print("You entered "+str(divisible )+" number(s) that are divisible by 3.")
print("You entered "+str(notdivisible )+" number(s) that are not divisible by 3.")
Sagot :
We are happy to have you as part of our community. Keep asking, answering, and sharing your insights. Together, we can create a valuable knowledge resource. IDNLearn.com is dedicated to providing accurate answers. Thank you for visiting, and see you next time for more solutions.