Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Completed Exercises #1161

Open
wants to merge 6 commits into
base: more_exercises
Choose a base branch
from
Open

Completed Exercises #1161

wants to merge 6 commits into from

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