gfhtnght
Day 1 task
1]Write a program in Python which wo
2]Write a program in Python in which you should display your following details:
a)Full Name( String concatenation should be used)
b)College name with address (Use string concatenation)
c)Initialize marks of 5 different subjects with good variable names.
d)Calculate and display the total marks, percentage.
Day 2 task
1] Write a program in Python which should contain at least 7 different methods of the list, tuples, sets, dictionaries. (Program should be written in 4 different .py for each of them).
2]Create a text file and write the answers to the following questions in it.
1.Why is the list used?
2.How do lists and sets differ?
3.Application of dictionaries with a real-world example ?
Day 3 task
1]Write a program in python which should include 5 different functions for the following use:
a)Function should return your full name
b)Function should return your total marks
c)Function to return your percentages on basis of marks
d)Function should return your grade with the following criteria:
score >= 95 : "A"
score >= 85 && score<=95 : "B"
score >= 75 && score<=85 : "C"
score >= 65 && score<=75 : "D"
e)Function to print all the details of a student, so here this function should call all other functions to print the name, marks, grades, percentage.
2]Write a program in Python to calculate the length of two strings by concatenating them.
3]Write a program in Python to print all the numbers till 10 except 3, 7 using for and while loop.
Day 4 task
1]Write a program in Python which would print all the prime numbers in a n*n matrix.
2]Write a program in python which would contain a main.py file and should import other python files as modules and make the use of all the functions defined in the module, the different files should have the following function definition:
a) A python file which should have a function to calculate the square of a number, find the maximum of a number in a list, minimum of a number in a list. Sum of all numbers in a list. (Not allowed to use default python function)
b)A python file which should have a function to find the middle character of a string, count the number of vowels in a string, calculate the length of the string, calculate the number of words in a string.
c)A python file which should show the use of all logical operators of python as different function definitions.
Day 5 task
1]Write a program in Python which makes use of the Python error handling, your program should include try, catch, raise keyword.
2]Write a program in Python which makes use of the different match functions(min 3) and the sort function for list, tuples, sets etc.
3]Write a program in Python to read a text file and print it’s content.
4]Write a program in Python which should take a string of 3-4 lines and write it to a txt file.
Day 6 task
1]Write a function for checking the speed of drivers. This function should have one parameter: speed.
If speed is less than 70, it should print “Ok”.
Otherwise, for every 5km above the speed limit (70), it should give the driver one demerit point and print the total number of demerit points. For example, if the speed is 80, it should print: “Points: 2”.
If the driver gets more than 12 points, the function should print: “License suspended”
2]Write a Python program to remove an empty tuple(s) from a list of tuples.
Sample data: [(), (), ('',), ('a', 'b'), ('a', 'b', 'c'), ('d')]
Expected output: [('',), ('a', 'b'), ('a', 'b', 'c'), 'd']
3]Write a Python function that accepts a string and calculate the number of upper case letters and lower case letters.
4]Find all occurrences of “at” in given string ignoring the case(take string as input from user.)
5]Create a function to count number of words in a sentence (Take input from user)
6]A positive integer, n, is said to be perfect if the sum of its proper divisors equals the number itself. (Proper divisors include 1 but not the number itself.) If this sum is less than n, the number is deficient, and if the sum is greater than n, the number is abundant.
Use the function name and the argument as:
def findType(n):
The Function should return 1 if the given integer is a deficient number, return 0 if it is a perfect number and return -1 if it is a abundant number.
7]Create a function named check_marks.
This method checks whether the marks is greater than or equal to 90 and if it is greater than or equal to 90, the method returns True.
If the marks is less than 90, a custom Exception named NotEligibleException is raised and an appropriate message as shown in the sample output is disp