Answers for "get the largest of 2 strings python"

-1

get the largest of 2 strings python

s1 = 'longlongstring'
s2 = 'shortstring'

longestString = max(s1, s2, key=len)

# returns 'longlongstring'
Posted by: Guest on June-10-2020

Code answers related to "get the largest of 2 strings python"

Python Answers by Framework

Browse Popular Code Answers by Language