Python 3 Tutorial | Length Function

Pubblicato il: 02 ottobre 2019
sul canale di: Dike Chris
1,293
17

Length Function in python is the len() function. len() function is an inbuilt function used to determine the length of a string, list, tuple and set. To find the Length of a string, say "s1" using the len() function, you call the len() function and pass string s1 as an argument to the len() function. for example:
s1 = "Dkchris Academy"
s2 = len(s1)
print(s2)
the result will be 15.
On the same note, if I have list, tuple and set, say
t1 =("four","three","two","one")
l1=[1,2,3,5,78,90,23]
set1 = {34,5,6,78,9,12,34}
I can find the length of variable t1, l1 and set1 as follows
len(t1) which will equal 4
len(l1) which will be 7
len(set1) which will equal 7 too.


In questa pagina del sito puoi guardare il video online Python 3 Tutorial | Length Function della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Dike Chris 02 ottobre 2019, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 1,293 volte e gli è piaciuto 17 spettatori. Buona visione!