This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
try: | |
usr = input('Enter operation: ') | |
pu = int(eval(usr)) | |
print(pu) | |
except NameError as ne: | |
print('You need to enter a mathematical operation') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
#Author: Blackman White | |
#Description: Program that checks if a number (inputted by the user) is even or odd | |
def check_even(num): | |
hnum = int(num / 2) | |
if hnum * 2 != num: | |
print("Number is odd") | |
else: | |
print("number is even") |