<jupyter_start><jupyter_text><jupyter_code>#List Methods
lst =["PC", 5, 72.16]
 
lst.append("BE")         #adds item to the end of the list
lst
lst.reverse()  #reverse the elements of the list in place
lst
lst.insert(0,5) # insert the element at given position in list
print(lst)
print(lst.count(5))  # returns no.of times element appear in the list
print(lst.count(72.26))
print(lst.count("PC"))
lst.remove(5)
lst
# Dictionaries
dit={"nm":"PC", "rn":5, "mks":65.17}
dit
dit.items() #returns key:value pair
 print (" Keys in dictionary -   ")
dit.keys()    #returns keys from dict
d1={"rn":6} 
d2={"strm":"BE"}
dit.update(d1)  #adds or updates element with given key
dit.update(d2)
dit
dit.pop("strm") #pops elemen
dit
dit.get("nm") #returns value of given key
#Sets
St={"apple","banana","kivi"}
St1={"orange","pineapple","kivi"}
St.union(St1) #returns set of all elements from both sets by removing duplicate
St1.intersection(St) #returns all elements common in both sets
St.difference(St1) # returns all elements from set St by removing duplicate from both
St.symmetric_difference(St1) #removes common elements and gives rest of the elements
St.isdisjoint(St1) # if no common element then gives true value
#Tuple
Tup=("PC",6,72.16,6)
Tup
Tup.count(6) #returns the number of times the element occus in Tuple
Tup.index(6) # returns the position of the element in Tuple
#Strings
str="india"
str.capitalize() #returns the string with first letter in capital
str="MAHARASHTRA"
str.casefold() #returns caseless copy of a string
Str="Pranali"
print (Str)
Str.endswith("i") #returns true if string ends with soecified suffix
Str.find("a") #returns the lowest index in string where the substring found
Str.isalpha() #returns true if all the characters are alphabetic<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12353269983230855, 'fraction_numerical': 0.02068194522079374, 'mean_word_length': 5.462093862815885, 'pattern_counts': {'":': 5, '<': 5, '<?xml version=': 0, '>': 5, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '512884', 'license': 'Apache-2.0', 'n_tokens_mistral': 616, 'n_tokens_neox': 593, 'n_words': 217, 'path': 'Assignment_1.ipynb', 'repo_name': 'Pranali-Titvekar-13/LetUpgalrade-Python', 'size': '1789'}