Question: my function program is asking to neter the number twice. I need to prevent it. The out must be Asking the User to a
my function program is asking to neter the number twice. I need to prevent it. The out must be" Asking the User to a number o ly one time and the sqaring of number"
def getValue(): val = int(input("Enter a number: ")) return val # how do I pass the "return val" result to the next function? Thank you. def getSqvalue(): sqval = getValue()**2 return sqval myValue = getValue() mySqvalue = getSqvalue() print ("The value entered is: " , myValue) print ("The Square of the Value enterd is: " , mySqvalue)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
