Question #949

What is the output of the code snippet below?
x = "5 6 7 77 22222"
y = x.split(" ")
print(max(y))

In this case, the split() function returns a list of strings. As a string, 77 is evaluated as greater than 22222 as 7 is greater than 2. (careerkarma.com/blog/python-compare-strings)


Comment on Disqus:

Question difficulty: 🔵🔵🔵🔵🔵


Similar questions: