<jupyter_start><jupyter_text>Template String  method-1<jupyter_code>from string import Template
templ=Template("My name is ${name} and i am ${passion}")
str1=templ.substitute(name='<NAME>',passion='Python Developer')
print(str1)<jupyter_output>My name is <NAME> and i am Python Developer<jupyter_text>method2<jupyter_code>print('My name is {0} and i am {1}'.format('<NAME>','Python Developer'))
(set() and range(0))==False<jupyter_output><empty_output><jupyter_text>Built-In-Function<jupyter_code>list1=[1,3,4,5,6,1]
list2=[1,3,4,5,0,1]
list3=[0,0,0]
print(any(list1))
print(any(list2))
print(any(list3))
print(all(list1))
print(all(list2))<jupyter_output>True
False<jupyter_text>Iterators<jupyter_code>l=[1,2,3]
i=iter(l)
next(i)
next(i)
next(i)
next(i)<jupyter_output><empty_output><jupyter_text>Enumerate<jupyter_code>l=['keshav','singh','jadon','rajpoot']
print(list(enumerate(l)))
print(list(enumerate(l,100)))
for i,j in enumerate(l,20):
    print(i,j)<jupyter_output>20 keshav
21 singh
22 jadon
23 rajpoot<jupyter_text>Zip<jupyter_code>l=['keshav','singh','jadon','rajpoot']
l1=['hi','hello','welcome','prabhu']
for i,j in zip(l,l1):
    print(i,j)
l=['keshav','singh','jadon','rajpoot']
l1=['hi','hello','welcome']
for i,j in zip(l,l1):
    print(i,j)<jupyter_output>keshav hi
singh hello
jadon welcome<jupyter_text>transform functions like sorted,filter,map<jupyter_code>def f1(x):
    if x%2==0:
        return x**2
    else:
        False
def f2(x):
    return x**2
l=[1,2,17,14,5,6]
print(list(map(f1,l)))
print(list(map(f2,l)))
print(list(filter(f1,l)))
sorted(l)
def f2(x):
    if x.isupper():
        return False
    else:
        return True
s='kesHavsInghJadOnRajpUT'
print(list(filter(f2,s)))<jupyter_output>['k', 'e', 's', 'a', 'v', 's', 'n', 'g', 'h', 'a', 'd', 'n', 'a', 'j', 'p']<jupyter_text>Itertools<jupyter_code>import itertools as it
'ABCD'+'1234'
list(it.chain('ABCD'+'1234'))
def fl(x):
    if x<40:
        return True
l=[10,20,30,20,40,10,50]
list(it.dropwhile(fl,l))
list(it.takewhile(fl,l))
any("0")
print(map.__doc__)
import collections as c
print(c.__doc__)
print(c.deque.__doc__)<jupyter_output>deque([iterable[, maxlen]]) --> deque object

A list-like sequence optimized for data accesses near its endpoints.<jupyter_text>Lambda  Case-1<jupyter_code>def f(n):
    return lambda a:a*n
x=f(2)
print(x)
print(x(5))
x(5)<jupyter_output><empty_output><jupyter_text>Keyword arg  Case-1<jupyter_code>def f1(*a):
    print(a)
f1(1,3,4,5)<jupyter_output>(1, 3, 4, 5)<jupyter_text>Case-2<jupyter_code>def f1(*a,k=False):
    print(a)
f1(1,2)
f1(1,2,False)
f1(1,2,False,1,True)<jupyter_output>(1, 2, False, 1, True)<jupyter_text>Case-3<jupyter_code>def f2(a,b,*,k=False):
    pass
f2(1,2,True)
f2(1,2,4,5,6)
f2(1,2,k=True)
f2(1,6,k=True)<jupyter_output><empty_output><jupyter_text>Case-4<jupyter_code>def f3(a,b,k=False):
    pass
f3(1,2,True)<jupyter_output><empty_output><jupyter_text>DocString<jupyter_code>def f(x):
    """<NAME>"""
    pass
print(f.__doc__)
def f(x):
    "<NAME>"
    pass
print(f.__doc__)
def f(x):
    '<NAME>'
    pass
print(f.__doc__)
def f(x):
    #<NAME>
    pass
print(f.__doc__)
def f(x):
    """
    Keshav 
    Singh
    Jadon
    """
    pass
print(f.__doc__)<jupyter_output>Keshav 
    Singh
    Jadon
{'fraction_non_alphanumeric': 0.19926425505824646, 'fraction_numerical': 0.04475781729000613, 'mean_word_length': 6.787589498806683, 'pattern_counts': {'":': 0, '<': 56, '<?xml version=': 0, '>': 56, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '14', 'dir': 'jupyter-structured-clean-dedup', 'id': '537333', 'license': 'MIT', 'n_tokens_mistral': 1552, 'n_tokens_neox': 1508, 'n_words': 223, 'path': 'Linkedin/python3/Untitled.ipynb', 'repo_name': 'Dhaneshgupta1027/Python', 'size': '3328'}