<jupyter_start><jupyter_text>Assignment 1 Day 9<jupyter_code>#downloading pylint

! pip install pylint
%%writefile prime.py

'''
Creating a python file for finding whethere the given number is prime number or not.
'''

def is_prime(given_no):
    '''
    function to check  for prime number.
    '''
    if given_no >= 1:
        for i in range(2, given_no):
            if (given_no % i) == 0:
                final_result = "Not Prime"
            else:
                final_result = "Prime"
    else:
        final_result = "Not Prime"
    return final_result
! pylint "prime.py"
%%writefile primeUnitTest.py

import unittest
import prime

class testPrime(unittest.TestCase):
    def testSinglePrime(self):
        a = 3
        result = prime.is_prime(a)
        self.assertEquals(result, "Prime")
        
    def testingDoublePrime(self):
        b = 11 
        result = prime.is_prime(b)
        self.assertEquals(result, "Prime")

if __name__ == "__main__":
    unittest.main()
! python "primeUnitTest.py"<jupyter_output>primeUnitTest.py:9: DeprecationWarning: Please use assertEqual instead.
  self.assertEquals(result, "Prime")
..
----------------------------------------------------------------------
Ran 2 tests in 0.003s

OK<jupyter_text>Assignment 2 Day 9<jupyter_code>#Make a small generator program for returning armstrong numbers between 1-1000 in a generator object
lst = list(range(1,1000+1))
# Generator to generate armstrong numbers between the given range

def armstrong(lst):    
    for num in lst:
        s = 0
        temp = num
        while temp > 0:
            d = temp % 10
            s += d ** 3
            temp //= 10
        if num == s:
            yield num
list(armstrong(lst))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1320754716981132, 'fraction_numerical': 0.019439679817038306, 'mean_word_length': 2.2169117647058822, 'pattern_counts': {'":': 1, '<': 8, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '604011', 'license': 'Apache-2.0', 'n_tokens_mistral': 564, 'n_tokens_neox': 523, 'n_words': 157, 'path': 'day 9 assignment.ipynb', 'repo_name': 'vighnatha/letsupgrad-', 'size': '1749'}