*Friday CLOSED

Timings 10.00 am - 08.00 pm

Call : 021-3455-6664, 0312-216-9325 DHA 021-35344-600, 03333808376, ISB 03333808376

Python For Beginners – Writing Your First Python Program in Canada, Toronto, Calgary

Python For Beginners - Writing Your First Python Program

About

One of the primary lessons for any beginner in Programming is the ‘Hello World’ program. Here, we will see how the ‘Hello World’ Program is executed and also get you started with what Python is all about. To master Python you need to work with real-world case studies & this blog is a stepping stone towards it.

Python is a general purpose interpreted, high-level and object-oriented programming language. This language is easy to learn, read and maintain. It is also portable and is often called a beginners’ language. It supports almost every operating system and is quite a simple language.  Python has a very straightforward syntax, while encouraging programmers to program without boilerplate (prepared) code.

The simplest directive in Python is the “print” directive – it simply prints out a line (and also includes a newline, unlike in C). There are two major Python versions, Python 2 and Python 3. Python 2 and 3 are quite different. This tutorial uses Python 2, because it is more widely used and supported. However, Python 3 is more semantically correct, and supports newer features.

Learn More

Python : Hello World Program

How do we go about writing a simple Hello World Program in the Python world? Let us take a look:

Step 1: Download Python

Python 101 - Hello World Program
Python 101 - Hello World Program

Download Python for your Operating system.

Step 2: Install Python 

Python 101 - Hello World Program
Python 101 - Hello World Program
Python 101 - Hello World Program

Step 3: Go To Python Install directory (Cmd)

Python 101 - Hello World Program

Default Location for Python 3.4 is: C:/Python34

Course Curriculum

Python Scripting Certification Training

  • Self-Paced Learning
  • Real-life Case Studies
  • Assignments
  • Lifetime Access

Explore Curriculum

Python 101 - Hello World Program

Alternatively you can open the Python shell from the Python Install Directory:

Step 4: Hello World Program

Now, the syntax of the actual program depends on the version of the python program being used:

Python 101 - Hello World Program

On the command Line, write the Python code:  print (“Hello World”) and push Enter. Python will automatically echo the Output to screen.

Alternatively, if one wants to execute Python code post, saving the code in a file here is what one can do:

Start up your favorite editor and save the following into a file:

 print "Hello, World!"

To execute this program, save it with a suffix of ‘.py’ (e.g., HelloWorld.py) and type ‘python’ and the filename in a shell like this:

 > python HelloWorld.py

The output is predictable:

Python 101 - Hello World Program

Hello, World!

If you prefer to execute it by its name, instead of as argument to the Python interpreter, put a “bang” line at the top. Include the following on the first line of the program, substituting the absolute path to the Python interpreter for /’path/to/python’:

#!/path/to/python

Be sure to change the permission on the file to allow execution, if necessary for your operating system.

We hope this helps you give a kick start to Learning Python!

Related Courses – Learn Online Now

RPA (Robotic Process Automation)

Machine Learning with 9 Practical Applications

Mastering Python – Machine Learning

Data Sciences with Python Machine Learning 

Data Sciences Specialization
Diploma in Big Data Analytics

Learn Internet of Things (IoT) Programming
Oracle BI – Create Analyses and Dashboards
Microsoft Power BI with Advance Excel

Join FREE – Big Data Workshop 

sharing is caring
Print Friendly, PDF & Email

Leave a Reply


ABOUT US

OMNI ACADEMY & CONSULTING is one of the most prestigious Training & Consulting firm, founded in 2010, under MHSG Consulting Group aim to help our customers in transforming their people and business - be more engage with customers through digital transformation. Helping People to Get Valuable Skills and Get Jobs.

Read More

Contact Us

Get your self enrolled for unlimited learning 1000+ Courses, Corporate Group Training, Instructor led Class-Room and ONLINE learning options. Join Now!
  • Head Office: A-2/3 Westland Trade Centre, Shahra-e-Faisal PECHS Karachi 75350 Pakistan Call 0213-455-6664 WhatsApp 0334-318-2845, 0336-7222-191, +92 312 2169325
  • Gulshan Branch: A-242, Sardar Ali Sabri Rd. Block-2, Gulshan-e-Iqbal, Karachi-75300, Call/WhatsApp 0213-498-6664, 0331-3929-217, 0334-1757-521, 0312-2169325
  • ONLINE INQUIRY: Call/WhatsApp +92 312 2169325, 0334-318-2845, Lahore 0333-3808376, Islamabad 0331-3929217, Saudi Arabia 050 2283468
  • DHA Branch: 14-C, Saher Commercial Area, Phase VII, Defence Housing Authority, Karachi-75500 Pakistan. 0213-5344600, 0337-7222-191, 0333-3808-376
  • info@omni-academy.com
  • FREE Support | WhatsApp/Chat/Call : +92 312 2169325
WORKING HOURS

  • Monday10.00am - 7.00pm
  • Tuesday10.00am - 7.00pm
  • Wednesday10.00am - 7.00pm
  • Thursday10.00am - 7.00pm
  • FridayClosed
  • Saturday10.00am - 7.00pm
  • Sunday10.00am - 7.00pm
Select your currency
PKR Pakistani rupee
WhatsApp Us