notebooks - jupyter notebooks based on Group B (Circuits Branches Syllabus)
- Lab1 - First 3 experiments mentioned in syllabus forms Day 1 of lab Lab2 - Experiments 4 to 8 forms Day 2 of lab Lab3 - Experiments 9 to 14 forms Day 3 of lab Lab4 - Experiments 15 to 18 forms Day 4 of lab. prime.py in same folder is a helper code for this lab.
demos - Fun/Interesting problems for classroom demo/discussion
- pi - Compute pi - montecarlo using random values
- pi_nonrandom - Compute pi using monte-carlo but don't use random
- hanoi - Tower of hanoi solver
Create a simple desktop calculator using Python. Implement only the five basic arithmetic operators.
Create, concatenate, and print a string, and access a sub-string from a given string.
Familiarize yourself with displaying date and time in various formats. For example: Thu Jul 11 10:26:23 IST 2024.
Write a program to create, append, and remove elements in lists using NumPy.
Write a program to find the largest of three numbers.
Convert temperature values back and forth between Celsius (c) and Fahrenheit (f).
- Formula:
c/5 = (f - 32)/9
Write a program to construct patterns of stars (*) using a nested for loop.
Create a program that prints all prime numbers less than a given number N.
Write a program to find the factorial of a number using recursion.
Write a recursive function to add two positive numbers.
Write a recursive function to multiply two positive numbers.
Write a recursive function to find the greatest common divisor (GCD) of two positive numbers.
Create a program that accepts the lengths of three sides of a triangle as inputs. The program should output whether or not the triangle is a right triangle. (Recall from the Pythagorean Theorem that in a right triangle, the square of one side equals the sum of the squares of the other two sides.) Implement this using functions.
Write a program to define a module to find Fibonacci Numbers and import the module to another program.
Write a program to check whether a given number is a valid mobile number or not using functions.
- Rules:
- Every number should contain exactly 10 digits.
- The first digit should be 7, 8, or 9.
Input two lists from the user. Merge these lists into a third list such that in the merged list, all even numbers occur first followed by odd numbers. Both the even numbers and odd numbers should be in sorted order.
Write a program to play a sticks game in which there are 16 sticks. Two players take turns to play the game. Each player picks one set of sticks (needn’t be adjacent) during their turn. A set contains 1, 2, or 3 sticks. The player who takes the last stick loses the game. The number of sticks in the set is to be input.
Suppose you're on a game show, and you are given the choice of three doors. Behind one door is a car; behind the others, goats. You pick a door, say No. 1, and the host, who knows what is behind the doors, opens another door, say No. 3, which has a goat. He then asks, "Do you want to pick door No. 2?" Is it to your advantage to switch your choice?