Question: for the above python : # function to print yes / no # based on boolean value def myfunc 1 ( must _ print )

for the above python :
# function to print yes/no
# based on boolean value
def myfunc1(must_print):
if must_print:
print("Yes")
else:
print("Sorry,No")
myfunc1(False)
# ******************************************************
# myfunc2
x = input( "please enter the string(windy/sunny/rainy):")
def myfunc2(str):
if str == "windy":
rval=" Please put on a jacket."
return rval
elif str == "sunny":
rval= "Enjoy this beautiful day."
return rval
elif str == "rainy":
rval= "Lets play Scrabble."
return rval
print(myfunc2(x))
# ***********************************************************
# myfunc3
def myfunc3(a, b, c):
'''function to perform the operation'''
if c%2==0:
print("Third number is even, so answer is")
sum = a + b
return sum
else:
print("Third number is Odd so answer is")
prod = a * b
return prod
x = int(input("Please enter value1:"))
'''only input integer type value'''
y=int(input("Please enter value2:"))
'''only input integer type value'''
z=int(input("Please enter value3:"))
'''only input integer type value'''
print(myfunc3(x,y,z))
#************************************************
# myfun4
def myfunc4(a, b):
if a > b:
print("value1 is greater than value2")
retval = True
return retval
else:
print("value2 is greater than value 1")
retval = False
return retval
m = int(input("Please enter val1:"))
n = int(input("Please enter val2:"))
print(myfunc4(m,n))
# ************************************************
# function to print value
# of x inside and outside the function
def my_own_func():
x =5
print("Value of x inside function:",x)
x =15
my_own_func()
print("Value of x outside function:",x)
# function to check
# whether x is even or odd
def OddEven(x):
if (x %2==0):
print("Entered number is even")
else:
print("Entered number is odd")
# calling the function
p=int(input("Enter a number to check ODD OR EVEN:"))
OddEven(p)
CAN YOU HELP WITH THE APPLICATION1PY
Create another Python program named application1.py.
This program imports the myFirstFunctions,py module.
Add a main function.
Create scenarios where application1 uses several functions in myFirstFunctions and completes simple tasks.
Place these calls in the main function.
Incorporate the use of the __name__ variable in both programs.
Apply a good programming style.
 for the above python : # function to print yes/no #

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!