Printing the value in the function, modify your function so that it returns a value of true or false. Do not print anything from inside function itself. Call your function and have the return result of the function (Boolean True or False). Do not create a string called "True" or "False". Do not create a string called "Equal" or "Not Equal" here. Actually return a boolean. Create a variable in your main code outside of the is_equal function store the returned result of the function. Use the variable you created to print "Equal" or "Not Equal" #python
Short Summary:
Implemented the program as per requirement
Attached source code and sample output
**************Please do upvote to appreciate our time.
Thank you!******************
Source Code:
def is_Equal(str1,str2):
if str1 == str2:
return True
else:
return False
if __name__ == '__main__':
result=is_Equal("Apple","Apple")
if result==True:
print("Equal")
else:
print("Not Equal")
Code Screenshot:
Output:
**************Please do upvote to appreciate our time.
Thank you!******************
Get Answers For Free
Most questions answered within 1 hours.