Q. Write a function that receives two string arguments and checks whether they are same-length strings (returns True in this case otherwise false).
You can understand by Watching video :-
Answer :-
def chr(a , b) : print( len(a ) == len(b) ) first = input("Enter First String :-") second = input("Enter Second String :-") chr(first , second )
Output :-
Enter First String :-Python
Enter Second String :-Portal
True
>>>
Enter First String :-Path
Enter Second String :-Walla
False
>>>
Enter First String :-ABCDE
Enter Second String :-VWXYZ
True
>>>
I guess u should write "Enter a string:" instead of "Enter a number"...likewise for second too
ReplyDeleteSorry, It is by mistake.
DeleteShouldn't it be :
ReplyDeleteif len(a)==len(b):
return "TRUE"
else:
return "FALSE"
Please run my program.
DeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )