CBSE Class 12 Computer Science
Question 99 of 103
Working with Functions — Question 5
Back to all questions 5
Question Write a function that receives two string arguments and checks whether they are same-length strings (returns True in this case otherwise False).
def same_length_strings(str1, str2):
return len(str1) == len(str2)
s1 = "hello"
s2 = "world"
s3 = "python"
print(same_length_strings(s1, s2))
print(same_length_strings(s1, s3))True
False