Python Atom Editor, Type() Function, User Input, Comments, Comparison Operators
As I continued learning Python (my 2nd and 3rd day), I have downloaded a coding editor Atom. There are many free code editors you can use. I have researched about it and apparently PyCharm Is pretty good also but I will download it later if needed. I will continue with Atom for now as it is recommended in my course.
I have coded the 'Hello World' function on Atom as well. A terminal can be installed from the installations page from "settings". It is possible to write code in the terminal in Atom as well.
I have downloaded the " platform-ide-terminal " package. After I opened the file, I could see the script in a terminal inside Atom.
PS: New files in Atom should have ".py" at the end to identify them as Python files.
Atom text editor, when you save a file with a.py extension, it merely utilizes, you can click the tab key and it travels in spaces. So that's extremely good, and it's just one of the many reasons why we recommend and prefer Atom for editing these files. So just remember that while tabs and spaces may appear the same on your computer, they may or may not be comparable in Python. And you can put up with the bogus errors that Python will generate if your tabs are incorrect.
Type() Function
We an ask Python what type something is by type() function. Here are some examples of how to use it.
>> type(eee)
<class 'str'>
>> type(1.0)
<class 'float'>
>>
It is also possible to execute type conversions with built-in functions like int() and float(). Also, when you put an integer and floating-point an expression, the integer is implicitly converted to a float.
It is also possible to convert between strings and integers using int() and float(). You will get an error if the strings do not contain numeric characters.
User Input
Python accepts user input. That implies we may solicit feedback from the user. We can instruct Python to pause and read data from the user, using the input() function.
Comments
It is very useful to add comments to your code for people and "yourself" to understand your code when looking again. That is why we can add comments with "#" to the code.
Comparison Operators
In this case, Boolean expressions are important. Boolean expressions ask a question and produce "Yes" or "No" results which we use to control program flow. Boolean expressions are using comparison operators to evaluate "True/False" or "Yes/No".
Here is a summary of comparison operators I have written: