length syntax in python code example
Example 1: how to get length of string in python
string = "test"
print(len(string))
Example 2: len python
mystring = 'Hello'
len(mystring)
mylist = ['Hello', 'Goodbye', 'Morning']
len(mylist)
Example 3: length of string python
string = "hello"
print(len(string))
if len(string) >= 10:
print("This string is grater then 10")
if len(string) <= 10:
print("This string is smaller then 10")
Example 4: length of a string python
string = "geeks"
print(len(string))
string = "geeks for geeks"
print(len(string))