<jupyter_start><jupyter_text>Question 1:Please write a program using generator to print the numbers which can be divisible by 5 and 7 between 0 and n in comma separated form while n is input by console. Example:If the following n is given as input to the program:100Then, the output of the program should be:0,35,70<jupyter_code>def generator(n):
    for i in range(n+1):
        if i % 5 == 0 and i % 7 == 0:
            yield i

n = int(input('Enter the number: '))
result = [str(i) for i in generator(n)]
print(','.join(result))<jupyter_output>Enter the number: 100
0,35,70<jupyter_text>Question 2:Please write a program using generator to print the even numbers between 0 and n in comma separated form while n is input by console. Example:If the following n is given as input to the program:10Then, the output of the program should be:0,2,4,6,8,10<jupyter_code>def even_num(n):
    for i in range(n+1):
        if i % 2 == 0:
            yield i
            
n = int(input('Enter the number: '))
result = [str(i) for i in even_num(n)]
print(','.join(result))<jupyter_output>Enter the number: 10
0,2,4,6,8,10<jupyter_text>Question 3:The Fibonacci Sequence is computed based on the following formula:f(n)=0 if n=0f(n)=1 if n=1f(n)=f(n-1)+f(n-2) if n>1Please write a program using list comprehension to print the Fibonacci Sequence in comma separated form with a given n input by console. Example:If the following n is given as input to the program:7Then, the output of the program should be:0,1,1,2,3,5,8,13<jupyter_code>def fibonacci(n):
    if n == 0:
        return 0
    elif n == 1:
        return 1
    else:
        return fibonacci(n-1) + fibonacci(n-2)

n = int(input('Enter a number: '))
values = [str(fibonacci(i)) for i in range(0, n+1)]
print(','.join(values))<jupyter_output>Enter a number: 7
0,1,1,2,3,5,8,13<jupyter_text>Question 4:Assuming that we have some email addresses in the "<EMAIL>" format, please write program to print the user name of a given email address. Both user names and company names are composed of letters only. Example:If the following email address is given as input to the program:<EMAIL>Then, the output of the program should be:john<jupyter_code>email = input('Please enter the mail address: ').split('@')
print(email[0])<jupyter_output>Please enter the mail address: <EMAIL>
john<jupyter_text>Question 5:Define a class named Shape and its subclass Square. The Square class has an init function which takes a length as argument. Both classes have a area function which can print the area of the shape where Shape's area is 0 by default.<jupyter_code>class Shape():
    def __init__(self):
        pass
    
    def area(self):
        return 0

class Square(Shape):
    def __init__(self, length=0):
        Shape.__init__(self)
        self.length = length
        
    def area(self):
        return self.length*self.length

ObjSquare = Square(5)
print(ObjSquare.area())
print(Square().area())<jupyter_output>25
0
{'fraction_non_alphanumeric': 0.10033783783783784, 'fraction_numerical': 0.03175675675675676, 'mean_word_length': 4.052901023890785, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 20, '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': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '656410', 'license': 'CNRI-Python', 'n_tokens_mistral': 999, 'n_tokens_neox': 940, 'n_words': 372, 'path': 'Programming_Assingment15.ipynb', 'repo_name': '14vpankaj/iNeuron_Programming_Assignments', 'size': '2993'}