Skip to content

Conversation

itava0
Copy link

@itava0 itava0 commented Jun 28, 2022

Completed the program# Write a function is_even that will return true if the passed-in number is even.

YOUR CODE HERE
def is_even(n):
if n%2==0:
return True
else:
return False

Read a number from the keyboard
num = input("Enter a number: ")
num = int(num)

Print out "Even!" if the number is even. Otherwise print "Odd"
YOUR CODE HERE
flag = is_even(num)
if flag:
print("Even!")
else:
print("Odd!")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants