a) Create two integer variables, and print them
b) Take two integers from the user, and print them
c) Take two integers from the user (a, b), and then print their sum, difference, product, power and remainder.
Input | Output |
---|---|
13 5 | 18 8 65 371293 3 |
a) Create an integer, a float, and a string variable. Print their types, using the type() function.
b) Take an integer, a float, and a string variable from the user. Print the variables.
Write a program that takes 3 integers from the user and then prints the sum, mean and multiple of the numbers.
Input | Output |
---|---|
13 27 14 | 54 18.00 4914 |
Using the formula below of compound interest, take the principal amount (A), interest rate (i) (per month) and duration (n) (months) and print the final amount.
Input | Output |
---|---|
1000 12 5 | 1762.34 |
500 12 5 | 881.17 |
Write a program which takes the values in Ohm of two parallel resistances and the generator's voltage in Volt respectively and print the currents that passes by each resistance.
Input | Output |
---|---|
2 8 40 | 20 5 |
5 5 10 | 2 2 |
Write a program that calculates the amount of seconds in a given period of years, months, days, hours and minutes respectively.
- 1 year = 365 days
- 1 month = 30 days
Input | Output |
---|---|
5 2 4 3 0 | 163220400 |
1 1 1 1 1 | 34218060 |