Computer Science, asked by Vijay7154, 9 months ago

What will be output of the following code if the user enters principle amount as 20000 and time as 10 years
p=input("enter principle amount)
if t > 10
si = p*t*10/100
else:
si= p*t*15/100
print(si)

Answers

Answered by AmritanshuKesharwani
0

Answer:

20000

Explanation:

First of all your code is wrong so I write a code to find simple interest in Python3. Use this code in your python3 compiler.

  • p=float(input("Enter principal ="))
  • r=float(input("Enter rate ="))
  • t=float(input("Enter time period ="))
  • print("Simple interest=",(p*r*t/100))

One Android Application for python3 compiler named Pydroid 3 for Android. Please install this application in your phone and use it for compiling your code. If you don't want to waste your time in pydroid 3 for Android, then compile python3 code in Linux (Termux). By using these steps in termux. Here, is some steps are as follows as:

  1. pkg update
  2. pkg upgrade
  3. pkg install python
  4. pkg install python2
  5. python

then write some python3 code and click on enter button or ok button. The code is compiled. Here, I am using float() because in some cases people write principal amount as Rs. 2450.78/- Then we need float so I am using here. I am using input() here for taking data from user as a input. I am using print() at last line to print the simple interest.

Learn more from this link here:

https://brainly.in/question/13165011

#Be Brainly

Similar questions