bluehost

Showing posts with label python basics. Show all posts
Showing posts with label python basics. Show all posts

Thursday, 25 February 2021

python Comparisons And Boolean Symbols.

Python comparisons are also called Relational operators. They are used to compare the values on either side of them and decide the relations among them.
Operators like equal to==, Not equal to!=, Greater than>, less than<, greater than or equal to>=, less than or equal to <= are used to compare values in python.

Python Booleans.
In python, the boolean data type is either True or False. The true or false keywords are used to define boolean variables.

Examples.

Equal to(==).
If the values on either side of the operator are equal, the outcome is true else false.
Print(2==3)
Outcome False. Because two and three are not the equal to each other.
Print(5==5)
Outcome True. Because the two are equal to each other.

Not equal (!=)
operator not equal evaluates to true if the items being compared are not equal and false if they are equal.
Print(1!=1)
False. Because one is equal to one.
Print(7!=11)
True.
Print(2!=7)
True.

Greater than(>).
Evaluates to True if the values on the left operand are greater than the values on the right operand.
Print(11>7)
True.
Print(6>6)
False.

Less than(<)
Less than evaluates to True if the value of the right operand is less than the value of the left operand.
Print(8<7)
False.
Print(7<9)
True.

Greater than or equal to(>=).
This comparison evaluates to True when comparing equal numbers. If the value of the left operand is greater than or equal to the value of the right operand, the condition becomes True.
Print(3>=9)
False. Because three is neither equal to nor greater than nine.
Print(7>=7)
True.
Print(6>=5)
True. Because six is greater than five.

Smaller than or equal to(<=)
If the value of the right operand is less than or equal to the value of the left operand, the condition becomes True.
Print(6<=5)
False
Print(3<=3)
True. three is equal to three and so the outcome is true.
Print(7<=8)
True

In conclusion, all of these python relational operators are very important for future coding. You need to master them keenly.

Monday, 15 February 2021

Advantages Of Python Programming language.

Python is one of the largest programming languages in the planet. It is used by big companies like Google and Nasa. It has many advantages and applications as detailed below.
1. Portable and extensible.
Python is supported by other platforms like Windows, Linux, play stations and many more.

2. Used for artificial intelligence.
Python is combined with libraries such as SciKit learning. Python can do complex calculations with just a single statement.

3. Computer Graphics.
Python is used to build Graphic User Interface GUI. It is used for desktop applications. Tkinter is the standard GUI library for python.

4. Python programming uses little coding.
In nature python has very simple syntax leading to smaller codes and hence saving on time.

5. Easy to learn.
Python uses simple to learn syntax, which helps beginners to understand the language faster.

React vs Angular; Front-End Web Development

Angular and React  are two of the most popular Javascript tools for front-end development. React is a Javascript created by Meta...