Sezione 3. Capitolo 8
single
Strings Have Length
Scorri per mostrare il menu
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}')
Compito
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.
Soluzione
Tutto è chiaro?
Grazie per i tuoi commenti!
Sezione 3. Capitolo 8
single
Chieda ad AI
Chieda ad AI
Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione