<jupyter_start><jupyter_text>Tutorial Discussing the difference between List and Tuples<jupyter_code>i=3
if i in [1,2,3,4]:
    print " exist ",i
else:
    print "Doesnt exist "
i=3
if i in (1,3):
    print "In tuple", i
for i in [1,2,3,4]:
    print i
x=(1,2)
for i in range(1,4,2):
    print x*i
x = lambda a,b: [a,b]*2
x(3,4)
lam = lambda a,b: (a,b)*2
lam(3,4)<jupyter_output><empty_output><jupyter_text>Mutability and Immutability in List and Tuples<jupyter_code>lis = [1,2,3,4]
lis[2]=10
lis
tupl = (1,2,3)
tupl[2]=10
tupl<jupyter_output><empty_output><jupyter_text>This means that tuple fails to support mutability as list<jupyter_code>a=(1,2)
x=[1,a,"a"]
x<jupyter_output><empty_output><jupyter_text>I can use Tuple in a list<jupyter_code>a=[1,2]
x=(4,a,5)
lam(1,x)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1633416458852868, 'fraction_numerical': 0.05486284289276808, 'mean_word_length': 6.36697247706422, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '633639', 'license': 'MIT', 'n_tokens_mistral': 383, 'n_tokens_neox': 374, 'n_words': 83, 'path': 'Homeworks/Homework 2/Mummadi_HW2_LIST_AND_TUPLES_TUTORIAL_Fall_2018.ipynb', 'repo_name': 'ShivaTejaMummadi/big-data-python-class', 'size': '802'}