Sectie 3. Hoofdstuk 8
single
Strings Have Length
Veeg om het menu te tonen
There is also a very useful function in Python that can give the length of a string -- len() function.
Let's look at the example of using this function.
123string = 'watermelon' length = len(string) print(f'the length of the string "{string}" is {length}')
Taak
Swipe to start coding
You have such strings apple,grape, orange.
You have to get the length of each of these strings. Using such comparison operators
>, < determine the longest string.
Oplossing
Was alles duidelijk?
Bedankt voor je feedback!
Sectie 3. Hoofdstuk 8
single
Vraag AI
Vraag AI
Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.