This repository contains Python codes for IT Workshop(3rd Sem)
- Write a program to convert temperature from degree Celsius to degree Fahrenheit.
- Write a program to calculate the area and perimeter of a rectangle.
- Write a program to swap the value of two variables using a third variable and without using a third variable.
- Write a program to swap two numbers using bitwise operators.
- Write a program to rotate the value of x, y, and z such that x has the value of y, y has the value of z and z has the value of x.
- Write a program to display the following numbers: 5678, 678, 78, 8, where the given number is 5678.
- Write a program to add two complex numbers by reading the numbers from the user.
- Write a program to accept the principal amount, rate of interest, and duration from the user. Calculate the interest amount and the total amount (principal + interest).
-
Write a program to sort three numbers using if-elif-else.
-
Write a program to calculate simple interest with the following conditions: If the principal amount is less than 2,00,000 the interest rate is 10%. If the principal amount is 2,00,000 -10,00,000 the interest rate is 12%. If the principal amount is greater than 10,00,000 the interest rate is 15%.
-
Write a program to print the following patterns:
a)
1
2 , 3
4, 5, 6
7 , 8, 9, 10
11, 12, 13, 14, 15
b)
-
Write a program using a while loop to print all the odd numbers within a given range.
-
Write a program to compute the GCD of two integer numbers.
-
Write a program to print the decimal equivalents of 1/2, 1/3, 1/4,. ........................... , 1/10 using for loop.
-
Write a program to check whether a given number is a prime number or not.
-
Write a program to check whether a given number is an Armstrong number or not.
-
Write a program to get the LCM of two positive integers.
-
Write a program to find the sum of all prime numbers within a given range.
-
Write a program that prompts users to enter numbers. This process repeats until the user enters -1. Finally, the program prints the count of prime and composite numbers entered.
-
Write a program to find the sum of the even-valued terms of the Fibonacci series up to 100.
-
Write a program to count the number of each vowel in a sentence.
-
Write a program to read a string and check whether the string is a palindrome or not.
-
Write a program to get a string from a given string where all occurrences of the last character have been changed to ‘*’, except the last character.
-
Write a program to count the occurrences of a word in a given sentence.
-
Write a program to get all substrings of a given string.
-
Write a program to detect whether two strings are anagrams or not.
- Write a program to find the maximum and minimum of a list of numbers without using built-in functions.
- Write a program to multiply two matrices as nested lists.
- Write a program to find the union of two lists.
- Write a program to concatenate two lists using list comprehension.
- Write a program to create a list from two given lists ‘list1’ and ‘list2’ of numbers such that it contains numbers that are present in ‘list2’ but not in ‘list1’.
- Write a program to find the distinct pair of numbers whose product is odd from a list of intege.
- Write a program to accept a sequence of comma-separated numbers from the user and generate a tuple with those numbers.
- Write a program to add elements in a tuple without using built-in functions.
- Write a program to calculate the mean of elements in a tuple of integers.
- Write a program to display unique and duplicate elements of a tuple.
- Write a program to count the frequency of all the elements in a tuple.
- Write a program to find the distinct pair of numbers whose product is even from a tuple of integers.
- Write a program to create a dictionary that contains (i, i*i) such that i is an integral number between 1 and n (both included).
- Write a program to count the numbers of characters in a string and store them in a dictionary.
- Write a program to create a dictionary by combining two lists ‘name’ for employee name and ‘salary’ for employee salary. Use the list ‘name’ as the key and ‘salary’ as the value of dictionary elements.
- Write a program to input player's name (string) and runs (integer) scored for n number of players where n should be input from the keyboard. Store the player’s details in a dictionary called 'cricket'. After preparing the dictionary, input the player's name and print the runs scored by the player otherwise returns'-1' if the player's name is not found.
- Write a program to sort (ascending order) a dictionary by value.
- Write a program to merge two dictionaries.