<jupyter_start><jupyter_text>Generators<jupyter_code># Make a small generator program for returning armstrong numbers  in between 1-1000 in a generator project.
i=1000
lst=list(range(i+1))
print(lst)
def getArmstrongNum(lst):
    for num in lst:
        sm=0
        temp=num
        order=len(str(num))
        while temp>0:
            digit=temp%10
            sm=sm+digit**order
            temp//=10
        if num==sm:
            yield (num)


print(list(getArmstrongNum(lst)))<jupyter_output>[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 153, 370, 371, 407]<jupyter_text>Unit Testing<jupyter_code># Write a python function  for finding  is a given number prime or not  
# and  do unit testing  on it using  PyLint and Unittest library
! pip install pylint
# PyLint
%%writefile prime_num.py
'''
It is a program for prime number
'''

A = 11

def isprime(num):
    '''
    Hey let's find out that the number is prime or not
    '''
    if num > 1:
        for i in range(2, num):
            if num%i == 0:
                print(num, "is not a prime number")
            else:
                print(num, "is a prime number")
    else:
        print(num, "is not a prime number")
isprime(A) 
! pylint "prime_num.py"<jupyter_output>************* Module prime_num
prime_num.py:19:10: C0303: Trailing whitespace (trailing-whitespace)

------------------------------------------------------------------

Your code has been rated at 8.89/10 (previous run: 8.89/10, +0.00)
{'fraction_non_alphanumeric': 0.15670103092783505, 'fraction_numerical': 0.04398625429553265, 'mean_word_length': 2.2645739910313902, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '117396', 'license': 'Unlicense', 'n_tokens_mistral': 531, 'n_tokens_neox': 476, 'n_words': 156, 'path': 'day_9 assignment.ipynb', 'repo_name': 'kunaldixit11/python.7', 'size': '1455'}