- Sep 2020
I have learnt these things about list: Lists are also sequence data types as strings but it can store heterogeneous data. list are also zero index based . List can be traversed using for loop . Lists are mutable unlike strings. Any operations made on lists , modifies it in place. Slicing can also be performed same as strings The plus operator concatenates two lists and comparison operators compares two lists element by element same as strings. Various built in methods of lists such as len,count,sort,append,extend etc are there. split method splits string into list and join method return a string of elements of list. Got to know about aliasing and many more.
I have learnt these things about strings: strings are sequence of characters and zero-index based. A char in a string can be accessed by using . A string can be traversed using for loop. Strings can be sliced to get a piece of string. Various built in methods area available such as len,find,lower,upper,capitalize,isalpha,isnumeric etc.
- operator concats two strings. comparison operaors compares teo strings lexicographically. Most importantly strings are immutable i.e once created they can't be modified.