Posts

More complex Arithmetic Operator

    Python supports the **  operator which multiplies a number to the power of another. Example 1:      >>> 2**4       #16 Example 2:     >>>-3**4       #this is executed as -(3**4) The first expression executes as (2**4) and the second one as -(3**4). Even though the precedence of operator - and + is higher than that of the exponentiation operator **, the operator binds less tightly that the operator on its right and more tightly than the operator on its left. Thus the unary operator - of -3 is executed on the result of the expression 3**4.    Python also supports the modula operator,%, which is used to return the integer remainder of a division sum.    Here's this operator is in use: >>> 14%3 # 2 That's all for today. Try this at home and comment me how it was. Is it working or not? If any doubt comment me. It will surely be solved. Tommorrow you will get information about Execution order of Arithmetic Operators. Enjoy learning

Syntax and Numerical Operators

Image
Lets start understanding some of the syntax and operators... Printing to the console       This is how a console window looks like.    One of the Python's simplest directives is the print directive. When executed, it prints out the stringified version of whatever we passed into it, and then appends a new line under that.    In Python 3, we have to use parentheses:                                              print('Python 3') Arithmetic Operators       Similar to other programming languages, Python allows the use of standard arithimetic operators. The four standard operators perform addition, subtraction, multiplication and division. The operators are +, -, *, /, respectively.    Here they are in use: >>> 210+32 # 242 >>> 6-43    # - 37 >>> 9*8.12 # 73.08 >>> 62/9    #6.8888..... In Python 3, using the division operator (/) will return a float. If you want to perform floor division, use the // operator

Python Environment

     Python comes pre-installed on most Linux distributions and is available as packages or installers on all other operating systems. To install python       1.go to www.python.org       2. scroll down and click and download the latest version of python.    After installing Python, open a new terminal (Unix/ MacOS) or Powershell (windows). Enter python 3 to run the Python IDLE shell.    IDLE stands for Integrated Development and Learning Environment. This process evaluates each line of code you write and outputs the result.    We shouldn't use the IDLE interpreter for longer snippets of code, however. It is much easier to write Python code using a text editor. There are a lot of option here, such as Atoms, Emacs, Vim, Sublime, PyCharm or Visual Studio Code, each with its advantages. Visual Studio Code, is a good option, as it was built on top of Atom's architecture, but avoids lot of overheads Atom doesn't. It is still highly customizable and much more responsive tha

Python versions

Now that we know that What is python? So, lets learn about some of the versions of Python. Python  2:     The final version of Python 2, version 2.7, came out in 2010. Although Python 3 is the largest generation of the language, many programmers still use Python 2.7.    One advantage of  Python 2 is that it has been around longer that Python 3, so there's more technical support and help available.    One minor difference between Python 2 and Python 3 is that in Python 2, print is treated as a statement instead of a function, therefore there's no need to pass arguments through parentheses, for example:                 Print ' Python 2' Python  3:      Python 3 was released in 2008 with the goal of making Python an easier language to use. In Python 3, we must pass the items we want to print explicity to the function in parantheses as follows:                 Print ('Python 3') Python 3 is the first Python release which is incompatible with previous ve

Python

Python I am aditya singh chauhan and i am back with another post for computer applications. Q1. What is python?python full form?why python? Ans. Python is an interpreted, high level, general purpose programming language.Created by guido van rossum and first released in 1991.python's design philosophy emphasizes code readability with its notable use of significant whitespace. python doesn't consists of any full form. Python got its name from BBC comedy series "Monty Python's Flying circus".   Python  is a general-purpose language, which means it can be used to build just about anything, which will be made easy with the right tools/libraries. Professionally,  Python  is great for backend web development, data analysis, artificial intelligence, and scientific computing. Now we are going to start our tutorial of python. Print() - This function is used to print assigned variable. ex -   a = 23          print(a) -------------------