3

I am setting up Sublime Text for using Python 3 and I am trying to run a very basic problem of calculating simple interest. However, my code just doesn't run. It builds just fine and shows no error. But it isn't taking input from the first step and doesn't do anything after that.

I have tried to change the build system. I installed Python 3 using terminal. Then I tried to see if the code runs on my friends Ubuntu environment, which it does on Spyder 3. Then I tried to create a custom system build for Python 3. But nothing seems to work.

Program to calculate simple interest:

p = float(input("Enter the Principal Amount : "))
r = float(input("Enter the Rate : "))
t = float(input("Enter the Time : "))
SI = ((p * r * t) / 100)
print("The Simple Interest is {}" .format(SI))

I am only getting the following output:

Enter the Principal Amount : 10

(The number 10 is typed by me. Nothing more happens even after i press enter)

kenlukas
  • 3,616
  • 9
  • 25
  • 36
  • Possible duplicate of [Sublime Text 2 console input](https://stackoverflow.com/questions/10604409/sublime-text-2-console-input) – idleberg Aug 21 '19 at 13:55

2 Answers2

3

Sublime Text does not support inputting data into a program. You can up vote this feature request on: Currently you can try to install the package and use it to run you program from a Sublime Text view. You you can try out the VSCode editor, which is pretty similar with Sublime Text.

Source

Omega
  • 48
  • 5
0

https://www.youtube.com/watch?v=R5-niid0m8A This video is very useful too! Just add SublimeREPL from Package Control: Install Package and then create the keyboard shortcut shown in the video. Although they are using mac, it doesn't matter.