Python 3 Tutorial | Length Function

Published: 02 October 2019
on channel: 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.


On this page of the site you can watch the video online Python 3 Tutorial | Length Function with a duration of hours minute second in good quality, which was uploaded by the user Dike Chris 02 October 2019, share the link with friends and acquaintances, this video has already been watched 1,293 times on youtube and it was liked by 17 viewers. Enjoy your viewing!