1mystring = 'Hello'
2#Counts the amount of letters in the string
3len(mystring) # = 5
4
5#Can also count the number of items in a list
6mylist = ['Hello', 'Goodbye', 'Morning']
7len(mylist) # = 3
1name = input("What is your name:- ")
2print("Hi "+name)
3
4lenth_got = len(name)
5print("so your name has got", lenth_got,"characters")
1# to get the length of a string or array, use the len() method
2my_string = "Hello World"
3my_list = ["apple", "banana", "orange"]
4
5print(len(my_string)) # outputs 11
6print(len(my_list)) # outputs 3