Skip to main content

Trick of the day

Hidden Google's 'blink html' trick

PYTHON

Python

- High level language
- Object-oriented programming language
- Interpreted scripting language - Debugging fast because there is no compilation
- Dynamic


PYTHON VERSIONS

Python 1.0features like: lambda, map, filter, and reduce.
Python 2.0features like: list comprehensions, garbage collection system.
Python 3.0 (Py3K

Latest version of python is 3.7.0

SIMPLE PYTHON PROGRAM

- Save the python files with .py extension 
- Execute the python program using below code

        python filename.py


Hello.py

print("hello")  

Python Variables

- We don't need to specify the type of variable.
Variable names can be a group of both letters and digits - kt1.
- They have to begin with a letter or an underscore - jk or _h.
- Use lowercase letters for variable name.
Variable name should not be a keyword.
- We can create variable at required time.

Variable Declarations

a=4

ty='software'

sal=2000.5

q=w=e=50

q,w,e=10,20,50


Identifiers

- Names given to variables ,class ,object ,functions , lists , dictionaries.
An identifier is a long sequence of characters and numbers.
No special character except underscore ( _ ) can be used as an identifier.
Keyword should not be used as an identifier name.
Python is case sensitive. So using case is significant.
First character of an identifier can be character, underscore ( _ ) but not digit.

Literals

String :-

1) Single line String 

           a="hai" or a='hai'

2) Multi line String 

           ab='hai\      
                  hello'                                             o/p -  haihello


           ab= '''''welcome                                 o/p - welcome
                       to                                                      to
                       world'''                                             world

Comments

Popular posts from this blog

How to take a screenshot in windows without using any software

Steps :- 1)Press alt+print screen ( to capture active window). 2)Open paint and press ctrl+v (to paste the screenshot). 3)If you are using Windows 8 or Windows 10, simply click the Windows Key + Print Screen .(it will automatically save a screenshot within the Screenshots folder of your picture directory).