Python

Python

Everything I learned from the following site.

https://www.tutorialspoint.com/python/python_environment.htm

PYTHONPATH

It has a role similar to PATH. This variable tells the Python interpreter where to locate the module files imported into a program. It should include the Python source library directory and the directories containing Python source code. PYTHONPATH is sometimes preset by the Python installer.

 

Indent

Indentation are blocks. Not braces.

Multi-Line Statements

line continuation character (\)

But, within the [], {}, or () brackets do not need to use the line continuation character.

Quotation in Python

‘hello’/ “hello” both accepted.

Comments in Python

#.

No multi line comment.

Waiting for the User

display the line and wait for user interaction.

input(“\n\nPress the enter key to exit.”)

 

Multiple Statements on a Single Line

‘;’ allows it. But makes it a single block.

Suite

blocks of individual statements are called suite. They follow a header line and ‘:’

if expression : 
   suite
elif expression : 
   suite 
else : 
   suite

Help

python -h

Variable

no declaration needed. Just assign.

Python has five standard data types −

  • Numbers
  • String
  • List
  • Tuple
  • Dictionary 

     

    number:

Python supports four different numerical types −

  • int (signed integers)
  • float (floating point real values)
  • complex (complex numbers)

https://www.tutorialspoint.com/python3/python_variable_types.htm

 

Data hiding:

__variable

__ makes variable private and can be accessible only from the member functions.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s