Posts

Python - While For and If Syntax

Python - While and For Loops and If Conditions Note:- Pay attention to spaces and indentation in Python. Each indentation indicates sub-statement to the previous statement like shown below :- Use # for comments Loops While Syntax:- counter =0 while(counter <= 5) :     print("counter",counter)     counter+=1 # end loop For Syntax:- for a in (1,2,3,5,7,8,9):     print(a) If Condition If Syntax:- if expression:   statements   .   . elif:   . else:   .

Introduction to Python

Python is a general purpose programming language. How to run Python and basic set up details in machines having windows operating system:- Install Anaconda on window machines Run Jupyter Notebook command in Anaconda command prompt Install Spyder via Anaconda Console Install Latest Python version (as of now Python 3) Either use Jupyter notebook or Spyder IDE for writing your python programs. As of now Pycharm is most popular but Spyder is also good enough and equivalent for writing python code.  In every language developers start by writing hello world program and nothing easier than writing it in Python. First Hello World Program in Python: print ("Hello World") Output : Hello World Viola First Program is done!!