Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # import random
- # i got rid of the random because its hard to test random numbers (you don't know what the value is!)
- # get input from you instead, you can randomize it later
- # get input from user. - don't change this function!
- def getInput():
- inp = input("Enter a number: ")
- return inp
- # make this function return true if the input parameter is even, false otherwise, you can change anything
- # here other than the function definition
- def isEven(someNumber):
- if someNumber == 2:
- return True
- else:
- return False
- #this is calling your input function and assigning the results to a variable
- userInput = getInput()
- #casting to an integer
- integerInput = int(userInput)
- #put something here to print "you entered x as your input"
- #if you fuck this part up, ask me about concatenation
- print ("something here")
- #this is where you use the isEven function (with return types!)
- if (isEven(integerInput)):
- print ("Your number is even!")
- else:
- print ("Your number is odd!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement