Sublime Forum

Python Noob question

#1

I’m very new to Python as in a matter of days. I am following a udemy tutorial and am unsure why I am getting different results than the instructor. I’ve attached a screenshot. It should be printing out pi to a certain number of decimal places, yet it is coming up with all 0’s.

Is this an issue with sublime edit? Do I have to set up something? I have a Mac if that makes any difference?

0 Likes

#2

The same code works in repl.it so how do I fix this?

0 Likes

#3

Sorted:

It was running Python 2

So I Installed Python 3 & Cython via Install Package from > Package Control, then I got the Python 3 option in Tools>Build>System.

That sorted the code issue and it works now.

47%20AM

0 Likes

#4

04%20AM

0 Likes

#5

23%20AM

0 Likes

#6

Glad you got your problem sorted!

As a tip for future questions, screenshots of code are not a great idea because if anyone wants to help you, they’re going to have to manually transcribe from your screenshot into a file to try it, instead of just a copy and paste.

That’s going to have an impact on the number of people willing to take the time to help you.

1 Like

#7

I, for one, would like to applaud you for not only solving your own problem, but (I consider this more important) also coming back to share the solution! Thank you!

1 Like