<jupyter_start><jupyter_text>Introduction to Programming - Lecture 2  Agenda for the class0. Linux terminal Basics (~20 minutes)1. Lists (~15 minutes)    - List functions such as append etc.    - Mutability    - Slicing/len()    - nested lists3. Basic Input and Output (5-10 minutes) 4. Creating a small program (Remaining time)   Lists1. A default python datatype.2. Strings and lists have some similar features, like length, indexing of elements etc.3. Basic differences from strings are    - Mutability: Lists are mutable whereas strings are not. This basically means we can make changes to lists after initiailizing but we can't do that in strings.    - Lists can have multiple datatypes within them.<jupyter_code>squares=[0,1,4,9,16,25] #list_name = [value1,value2,value3,...] 
print(squares)
print("Length is:",len(squares))
print(squares[3])
squares.append(36)
print(squares)
squares.append("forty-nine")
print(squares)
squares.extend([64,81])
print(squares)
squares[7]=49
print(squares)
print(squares[0:3])
4 in squares<jupyter_output><empty_output><jupyter_text>Some other list methods 1. list.index(x) 2. list.count(x)3. list.insert(i,x)Link: https://docs.python.org/3/tutorial/datastructures.html<jupyter_code>L1 = [ 10, [20,21,22,23], 30, [40,41], 50 ]
print(L1)
print(L1[0])
print(L1[1])
print(L1[0][0]) # L1[0] gives us the first element of the list, which is an integer(10). Since integers cannot be 
                # indexed like a string or list, we get an error.
print(L1[1][0])<jupyter_output><empty_output><jupyter_text>Input methods<jupyter_code>n1=input("Enter first number: ")
n2=input("Enter second number: ")

sum=n1+n2
print(sum)

a=int(n1)
b=int(n2)
sum=a+b
print(sum)
num='-3.15'
pie=float(num)
print(pie)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1320861678004535, 'fraction_numerical': 0.048752834467120185, 'mean_word_length': 5.348920863309353, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '258592', 'license': 'MIT', 'n_tokens_mistral': 685, 'n_tokens_neox': 628, 'n_words': 176, 'path': 'Week 2/Lecture_2_Lists_and_Slicing.ipynb', 'repo_name': 'bpgc-cte/python2017', 'size': '1764'}