Description
Question 1 solved
-
This code is saved in 1_1.py
-
This program allows the user to input the final account value, annual interest rate in percent and the number of years. The output would be the initial account value of money that has to be saved to obtain the final account value.
-
These input numbers should be positive real numbers.
-
Execute as followings:
Question 2
-
This code is saved in 1_2.py
-
This program allows the user to input a positive integer and displays each of its digits one by one (one digit per line).
-
The input number should be a positive integer.
-
Execute as followings:
Question 3
-
This code is saved in 1_3.py
-
This program allows the user to input a positive number. The output is the smallest integer n such that n**2 is greater than m.
-
The input number should be a positive number.
-
Execute as followings:
Question 4
-
This code is saved in 1_4.py
-
This program allows the user to input anything. But the table will only be printed if the input is a positive integer. The table with N rows and 3 columns. In the mth row, the program will output three numbers: m, m+1, and m**(m+1).
-
The input can be anything. If it is not a positive integer, the program will remind you and make you input again.
-
Execute as followings:
-
This code is saved in 1_5.py
-
This program allows the user to input anything. But only numbers>2 will be given primes smaller than itself. The output is all the prime numbers which are smaller than the input. And the output at most 8 prime numbers in each line.
-
The input can be anything. If it is a string or numbers<=0, the program will remind you to input a positive integer and make you input again. If it is 1 or 2, it will tell you that 1 or 2 has no prime smaller than itself and make you input again.
-
Execute as followings:
Question 6
-
This code is saved in 1_6.py
-
This program allows the user to input anything. But only function==sin or cos or tan, initial point and end point==number, n==a positive integer, only in this case, the result will be printed. The output is the result of the equation:
-
The input can be anything. But only correct format will be calculated, if you enter the wrong format, the program will remind you and make you enter again.
-
Execute as followings: