Saturday, February 27, 2021

Python Features

 Features of python

1. Simple and easy to learn:
  1. When we read python program, we can feel like reading English statements.
  2. Simple syntaxes.
  3. Very less number of lines as compared with other languages.
  4. More readability and simplicity.
  5. We can reduce development cost of the project.
2. Freeware and Open Source:
  1. We can use python without any license and it's freeware.
  2. no need to pay single paisa for using software.
3. High Level Programming Language:
  1. It is programmer friendly language.
  2. Being a programmer we are not required to concentrate low level activities like memory management and security etc.
4. Dynamically Typed:
  1. Data type is does not matter. whenever we are assigning the value, based on value type will be allocate automatically.


5. Interpreted:
  1. Being a programmer not required to compile python program. internally python interpreter will take care that compilation.
  2. An  interpreter is a program that reads and execute code line by line.

Identifiers:

Name of identifiers can be class name or Function name or Module name or Variable name.
 ex. 



here my_string is a identifier.

After reading about Identifiers what's in our  mind is there any rules to define variables or identifiers in python. answer is yes! python follows rules they are followings.
  1. Alphabet symbols it may be UPPER CASE or lower case.
  2. Identifier should not start with Digits.
  3. Identifiers are case sensitive.
>>> a = 10
>>> A = 20
>>> print(a)
10
>>> print(A)
20

      4. We can not use reserved word as identifiers.

Then question arise is how many keyword and what are they in python?
here is answer 
Steps:
  1. open command prompt 
  2. type py or python
  3. but insure that python already installed or not for that type python --version in cmd
  4. import keyword
  5. keyword.kwlist

All reserved words  in python contains only alphabet symbol.
Except the following - True, False and None.
    
   5.There is no length limits for identifiers


DATA TYPES IN PYTHON

Fundamental Data Types:

Fundamental data types are immutable. once create an object we can not perform any changes in that object.
  1. int
  2. float
  3. complex
  4. bool
  5. str

Collection Data Types:

  1. bytes
  2. bytesarray
  3. range
  4. list
  5. tuple
  6. set
  7. frozonset
  8. dict
  9. None
Brief explanations about Data type in next blog...….

  

        

No comments:

Post a Comment

A Step-by-Step Guide to Creating Users in Kubernetes

1. Create a User Account openssl req -new -newkey rsa:4096 -nodes -keyout pravin.key -out pravin.csr -subj "/CN=pravin/O=Infosys" ...