Skip to main content

2)Print function,Strings and Math basic calculations:

Print function, Strings and Math basic calculations:
Print function:
print() function in Python is a function that outputs to your console window whatever you say you want to print out.

Strings:
Strings are just "strings" of text.

Note:
The quotes may be single or double else you can escape them using backslash(\).

Example:



Concatenation:
use the "," -> it will print them out separately with a space.

use the "+" -> join integers and floats together, then you will perform an arithmetic operation.


Example:



Math basic calculations:
In python, math calculations are pretty simple enough and cool.


Example:




Comments

Popular posts from this blog

1)About Python Programming and environment setup steps

Step 1: Should be familiar with Python Programming: Let's think about Why Python? Python is a general-purpose language, which means it can be used to build about anything, will be made our programming easy with the right tools/libraries. Professionally, Python is great for web development, data analysis, artificial intelligence and scientific computing.  Note: Python developers used to build productivity tools, games, desktop apps and so on. Before to start programming, lets get download the latest version of python from https://www.python.org/ . which means in my case it's 3.6.4. Installation: Note: Also download the python IDE(pycharm) to make our code more precisely ordered.

3)Python - Variable Types:

Variables: Variables are reserved memory locations to store values. Which means that when you create a variable, will reserve some space in memory. Note: Python variables do not need explicit declaration to reserve memory space other languages like Java,C etc., The declaration happens automatically when you assign a value to a variable. The equal sign (=) is used to assign values to variables. So, in-turn, we should only focus on assignment of variable. Two ways of assignments: Single variable assignment Multiple variable assignment Example: Python Standard Data Types: Python has five standard data types Numbers String List Tuple Dictionary 1.Numbers: Number data types store numeric values. Python supports four different numerical types integers -> a=15 long integers -> a=1888L floating point -> a=9.8 complex numbers -> a=1+2j Note: A complex number consists of pair of real floating-point numbers denoted by x +...