Okay, as mentioned here SublimeText does not support the feature, but there are workarounds. It blows my mind why this is not a standard feature, but anyway. Your suggestion works and I thank you, sir :)
I will check the videos to make sure I didnt miss anything.
BTW, If anyone is searching for a IDE to use, here is a nice comparison:
I know now that i could have cast the class on the very begging like this:
>>> var1 = int(input())
2
>>> var2 = int(input())
4.89
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: invalid literal for int() with base 10: '4.89'
>>>
But i specify that to be integer its gives me error when you put in a fraction. Also i know there must be a way for python to recognize the input and assign appropriate type to variable but since I'm still on the begining of my python journey that's all i could come up with at the time. Also i noticed when i tested the code initial in the python shell it did what you just described with weird fractions. However when it was saved to a file and ran it worked fine. Perhaps you could explain why that is?
I'd cast them to floats upon input instead. The errors you're given when a user inputs a value that can't be converted to a float/int make more sense then - it points to the line on which they're inputted.
Also, it saves you from having to cast it to the desired type on every instance of you using that value later on.
Yes, I understood that bit. I only did the int() in the previous example to show that i have to use float since people will put in fractions. i'll try to cast int/floats on input next time. But when i asked for the explanation i was more referring to the weird fractions/output you were getting when working on floats in the python shell??
>>> a = 0.3
>>> b = 0.04
>>> a + b
0.33999999999999997
>>>
But when i saved this as a python script and ran the output was 0.34 as it should