- Write a program to calculate average of
nnumbers. Create a function for that and use*argsparameter to calculate the average. Solution - Write a program to determine whether a given number is prime of not. Solution
- Write a program to create a list of 1st 50 prime numbers. Solution
- Write a program to calculate sum of both 1st 100 even and odd numbers. Create separate functions for that. Solution
- Create a class
Complexto handle complex numbers of formata + bi. Use operator overloading for addition, subtraction, multiplication and division between these numbers. Solution - Create some classes name "Decimal" and "Binary". Write methods to do conversion from Decimal to Binary and vice versa. Follow these rules: Solution
Decimal: Has base 10, contains digits in range 0 to 9.
Binary: Has base 2, contains digits 0 and 1.
- Create a simple Stone, Paper, Scissor game in console/terminal. You must use your own logic to check for win/lose/draw. You can use random module to create a basic AI opponent. Solution
- Create a program to calculate area of different shapes such as triangle, square, rectangle, and circle. Create a class for each shape to hold basic information. Then, write method for each class to calculate area. All classes must be inherited from a base
Shapeclass which contains a method for area calculation, which can be then override inside child classes. Solution - Create a program to print following basic patterns (inside their own functions, then print them all as following order): Solution
*****
****
***
**
*
*
**
***
****
*****
*****
****
***
**
*
*****
*
***
*
*****
- Create a program to print the following pattern: Solution
**********
*|======|*
*|=~~~~=|*
*|=¦×צ=|*
*|=¦×צ=|*
*|=<__>=|*
*|======|*
*|======|*
**********