1.FPP (T+L) SYLLABUS-new
1.FPP (T+L) SYLLABUS-new
b) Write a program to compute the number of characters, words and lines in a file.
Exercise - 8 Functions
a) Write a function ball_collide that takes two balls as parameters and computes if they are
colliding. Your function should return a Boolean representing whether or not the balls are colliding.
Hint: Represent a ball on a plane as a tuple of (x, y, r), r being the radius If
(distance between two balls centers) <= (sum of their radii) then (they are colliding)
b) Find mean, median, mode for the given set of numbers in a list.
Exercise - 9 Functions - Continued
a) Write a function nearly_equal to test whether two strings are nearly equal. Two strings a and b are
nearly equal when a can be generated by a single mutation on b.
b) Write a function dups to find all duplicates in the list.
c) Write a function unique to find all the unique elements of a list.
Exercise - 10 - Functions - Problem Solving
a) Write a function cumulative_product to compute cumulative product of a list of numbers.
b) Write a function reverse to reverse a list. Without using the reverse function.
c) Write function to compute GCD, LCM of two numbers. Each function shouldn’t exceed one line.
Exercise 11 - Multi-D Lists
a) Write a program that defines a matrix and prints
b) Write a program to perform addition of two square matrices
c) Write a program to perform multiplication of two square matrices
Exercise - 12 - Modules
a) Install packages requests, flask and explore them using (pip)
b) Write a script that imports requests and fetch content from the page. Eg. (Wiki)
c) Write a simple script that serves a simple HTTP Response and a simple HTML Page
Exercise - 13 OOP
a) Class variables and instance variable
i) Robot
ii) ATM Machine
Exercise - 14 GUI, Graphics
a) Write a GUI for an Expression Calculator using tk.
b) Write a program to implement following figures using turtle
Exercise - 15 - Testing
a) Write a test-case to check the even numbers function even_numbers which return True on passing
a list of all even numbers.
b) Write a test-case to check the function reverse_string which returns the
reversed.
Exercise - 16 - Advanced
a) Build any one classical data structure.
b) Write a program to solve knapsack problem