N = int(input())
natural_num = {i:i**2 for i in range(N)}9
Assignment 31: dict
Create a dict object where the first N natural numbers are keys and their squares are data values.
Sort a dictionary by its keys in descending order.
Write a Python script to create a dictionary where keys are cricket player names and values are tuples containing:
total runs,
All data should be taken from the user.
Write a Python script to find the maximum-size batch code from a dictionary where keys are batch codes and values are batch sizes.
Write a Python script to create a dict object from a list of city names such that alphabets are keys and the value is the list of city names starting with that alphabet.
{key: values, key1:value1}, key and value together is item
dict(),{}
{8: 64, 7: 49, 6: 36, 5: 25, 4: 16, 3: 9, 2: 4, 1: 1, 0: 0}
dict_items([(0, 0), (1, 1), (2, 4), (3, 9), (4, 16), (5, 25), (6, 36), (7, 49), (8, 64)])
Assignment 32: Functions-1
Write a Python function to calculate sum of two numbers. (TSRS)
Write a Python function to calculate area of a circle. (TSRS)
Write a Python function to calculate average of three numbers. (TSRS)
Write a Python function to calculate compound interest. (TSRS)
Write a Python function to calculate volume of a cuboid. (TSRS)
Assignment 34: Functions-3
Write a Python function to print the first N odd natural numbers. (TSRN)
Write a Python function to print the first N prime numbers. (TSRN)
Write a Python function to print all prime numbers between two given numbers. (TSRN)
Write a Python function to print the first N terms of the Fibonacci series. (TSRN)
Write a Python function to print all factors of a given number. (TSRN)
[1,N] –> prime numbers
Assignment 35: Functions-4
Write a Python function to calculate LCM of two numbers. (TSRS)
Write a Python function to count words in a string. (TSRS)
Write a Python function to create a list of prime numbers between two given numbers. (TSRS)
Write a Python function to filter words from a text starting from the same alphabet and store them in a list. Then create a dictionary with alphabets as keys and lists of corresponding words as values. Take text as an argument and return the dictionary. (TSRS)
Write a Python function to find all common factors of two given numbers. Return a tuple of such factors. (TSRS)
{'I': 'I', 'a': 'am', 's': 'sleepy', 'g': 'guy'}
{'I': 'I', 'a': 'and', 's': 'sleepy', 'g': 'guy', 'i': 'intelligent'}
({'I', 'a', 'g', 'i', 's'},
['I', 'a', 's', 'g', 'a', 'i', 'g'],
['I', 'am', 'sleepy', 'guy', 'and', 'intelligent', 'guy'])
{'I': ['I'],
'g': ['guy', 'guy'],
'a': ['am', 'and'],
's': ['sleepy'],
'i': ['intelligent']}