Math Operations - Float
Rakul started learning Python3 to participate in the upcoming "CodeChamp" which is an University level coding competition which can provide some special privileges in the recruitment drives for the next 2 years only for those who make it to the "Top-100".His enthusiasm started falling when he find it difficult to understand the Mathematical operations involving "FLOAT".Help him to understand that easily.
Write the function definition for the function "Float_fun" which takes three parameters
- 'f1' which is a FLOAT Variable
- 'f2' which is also a FLOAT Variable &
- 'Power' is an INTEGER
Do the following and Print the Output as per the Sample Test Case :
1.Print "#Add"
2.Add 'f1' and 'f2' and Print it
3.Print "Subtract"
4.Subtract 'f2' from 'f1' and Print it
5.Print "Multiply"
6.Multiply 'f1' and 'f2' and Print it
7.Print "Divide"
8.Divide 'f2' by 'f1' and Print it
9.Print "Remainder"
10.Find the Modulus/Remainder of 'f1' by 'f2' and Print it
11.Print "#To_The_Power_Of"
12.Find 'f1' to the power of 'Power' and Print it
13.Print "Round"
14.Round the 12th value upto 4 decimal places and Print it
Input Format for Custom Testing:
# In the first line, value for 'f1'
# In the second line, value for 'f2'
# In the third line, value for 'Power'
Sample Test Case 1:
Sample Input
STDIN Function parameter ----- ------------------ 10.75 → f1 5.45 → f2 3 → Power
Sample Output
#Add 16.2 #Subtract 5.3 #Multiply 58.5875 #Divide 0.5069767441860465 #Remainder 5.3 #To_The_Power_Of 1242.296875 #Round 1242.2969
Comments
Post a Comment