Write the functions which are called in the main function given.
YOU MAY ASSUME THAT THE USER ENTERS A VALID INTEGER.
printDouble should accept one value and should print the value of that number times 2.
printEndMessage should not accept any values and should print a message indicating that the program has finished.
def main():
num1 = int(input("Please enter your number "))
printDouble(num1)
printEndMessage()
main()
Python code:
def printDouble(num):
doubleNum=num*2
print("Double of ",num," is ",doubleNum,sep=" ")
def printEndMessage():
print("The program has finished execution.")
def main():
num1 = int(input("Please enter your number "))
printDouble(num1)
printEndMessage()
main()
if you like the answer please provide a thumbs up
Get Answers For Free
Most questions answered within 1 hours.