Hello anonymous user.
I am starting to play around with IDLE.
This code is the first line of the program.
It does not make full sense to me.
First of all, why is from and import in yellow?
Secondly, what does it do?
I only understand that randint is random integer.
Why is is necessary? Without it the program does not work.
>>295302
random is a library
https://docs.python.org/2/library/random.html
and randint is a function in that library.
It's basically saying "from the 'random' library, import the 'randint' function". You could also just put "import random" and it would import the entire library and randint would still work.
>>295305
Alright. Thank you for you kind support.
Reserved words are anyways colored in python ide, as well as many others
Another quick question.
When I write
feeling_good = True
the 'feeling_good' is a variable I create, and I assign it a Boolean value 'True'.
?
>>295318
Thank you. Noted it.
>>295333
I'm not sure why you would do that, but I guess so
Python isn't really my strong point. But you're just saying feeling_good = 1, so it's kind of pointless to do that