00.0 Exercises For Python Programming
00.0 Exercises For Python Programming
1. Write a program to read two integers from STDIN and print five lines where:
2. Create a program to take the details of an employee (Name, Age, Position, and Salary)
from STDIN and print the four lines each containing one detail per line of the employee.
3. Create a program in which you will have two variables. These variables shall be assigned
different types of values (integer, float, complex, string) at different times. Print the
values and the types of the variables (one in each line) each time you assign a new value.
4. Write a program to remove characters from a string starting from zero up to n and
return a new string.
5. Given two integer numbers return their product only if the product is equal to or lower
than 1000, else return their sum.
6. Given an integer, n, perform the following conditional actions:
If n is odd, print Weird
If n is even and in the inclusive range of 2 to 5, print Not Weird
If n is even and in the inclusive range of 6 to 20, print Weird
If n is even and greater than 20, print Not Weird.
7. Write a program that takes three numeric values from STDIN and checks if these three
numeric values can be valid sides of a triangle.
8. Write a program that takes a numeric score of a student out of 100 from STDIN and
assigns a letter grade for the given score.
9. Write a program to read two strings from STDIN and print the two lines where:
A. The first line contains the concatenation of the two strings (first followed by second).
B. The second line contains the concatenation of the first half of the first, the first half of
the second, the second half of the first, the second half of the second.