<jupyter_start><jupyter_text>1.Check Primality<jupyter_code># def isPrime(n):
#     for i in range(2,n):
#         if(n % i == 0):
#             break
#             return False
#     return True

def isPrime(n):
    for d in range(2,n):
        if(n % d == 0):
            break
    else:
        return True
n = int(input())
isPrime(n)<jupyter_output>5<jupyter_text>2. Print all prime no from 2 to n<jupyter_code>def prime2toN(n):
    for k in range(2,n+1):
        is_k_prime = isPrime(k)
        if(is_k_prime):
            print(k)
prime2toN(20)<jupyter_output>2
3
5
7
11
13
17
19<jupyter_text>3. Calculating ncr<jupyter_code>def fact(n):
    fact = 1
    for i in range(1,n+1):
        fact = fact * i
    return fact
    
def ncr(n,r):
    ans_ncr = fact(n)//(fact(r)*fact(n-r))
    return ans_ncr
ncr(5,2)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13523131672597866, 'fraction_numerical': 0.03795966785290629, 'mean_word_length': 2.5020746887966805, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '631162', 'license': 'Apache-2.0', 'n_tokens_mistral': 373, 'n_tokens_neox': 355, 'n_words': 78, 'path': '01.Python-Basics/07. Functions/02.Few-Examples.ipynb', 'repo_name': 'PramitSahoo/Python-with-Data-Structures-and-Algorithms', 'size': '843'}