0% found this document useful (0 votes)
23 views18 pages

#02 Getting Start With Python

Uploaded by

umeeduna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views18 pages

#02 Getting Start With Python

Uploaded by

umeeduna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

GETTING START WITH

PYTHON
By Zeeshan Hussain (Software Engineer)

Portfolio: Universedeveloper.netlify.app | WhatsApp: +923181482800 | Lecturer: Zeeshan Hussain


ENVIRONMENT SETUP OF PYTHON
• First step in the journey of learning Python is to install it on your
machine.
• Python is available on a wide variety of platforms including Windows,
Linux and Mac OS.
• Downloading Python:
• You can download Python from https://www.python.org/

Portfolio: Universedeveloper.netlify.app | WhatsApp: +923181482800 | Lecturer: Zeeshan Hussain


INSTALLING PYTHON
• Double click on the file where it has been downloaded to start the
installation.
• Click on install now. Step 1

• Click on close.
Step 2

Step 3

Portfolio: Universedeveloper.netlify.app | WhatsApp: +923181482800 | Lecturer: Zeeshan Hussain


ADD PYTHON TO PATH
• Find Python Installation Directory
• Copy address path.
• Open the Edit the system environment variables.
• Click on Path > Edit > New.
• Paste copied address path in box.
• Click on Ok > Ok

Portfolio: Universedeveloper.netlify.app | WhatsApp: +923181482800 | Lecturer: Zeeshan Hussain


DOWNLOAD PYCHARM IDE
• PyCharm is an integrated development environment used for
programming in Python.
• PyCharm is developed by the Czech company JetBrains, initially
release in 30 October 2014.
• Written in Java and Python.
• Downloading PyCharm:
• You can download PyCharm from
https://www.jetbrains.com/pycharm/

Portfolio: Universedeveloper.netlify.app | WhatsApp: +923181482800 | Lecturer: Zeeshan Hussain


INSTALLING PYCHARM
• Double click on the file where it has been downloaded to start the
installation.
Step 1
• Click on Next > Next > Next > Install.
Step 2

Step 3

Step 4

Step 5

Portfolio: Universedeveloper.netlify.app | WhatsApp: +923181482800 | Lecturer: Zeeshan Hussain


OPEN PYCHARM
• Click on start Button.
• Search for PyCharm Community Edition.
• Click on PyCharm Icon.

Portfolio: Universedeveloper.netlify.app | WhatsApp: +923181482800 | Lecturer: Zeeshan Hussain


CREATE PYCHARM PROJECT
• First open PyCharm IDE.
• Click on Create New Project.
• Select any location to save the project files.
• Now click on Create/Next.

Portfolio: Universedeveloper.netlify.app | WhatsApp: +923181482800 | Lecturer: Zeeshan Hussain


CREATE FIRST PYTHON PROGRAM
• Open PyCharm.
• Right Click on project name, a list will appear.
• Next click on New and navigate to the right window and click on
python file.
• Give name to the file i.e. firstPrograme and click on ok.
• Write print(‘hello world’); and run it.

Portfolio: Universedeveloper.netlify.app | WhatsApp: +923181482800 | Lecturer: Zeeshan Hussain


PROGRAMMING ERRORS
• Errors in programming refer to issues or defects that arise within the
program, and the process of eliminating these errors is
called debugging.
• Types of Errors:
• Some common Types of Errors in Programming are listed below.
• Syntax Error
• Run-Time Error
• Logical Error

Portfolio: Universedeveloper.netlify.app | WhatsApp: +923181482800 | Lecturer: Zeeshan Hussain


SYNTAX ERROR
• It occurs when the programmer writes code that is not in accordance
(‫ ) کے مطابق‬with the syntax of the programming language.
• For example, let’s say the correct syntax for printing something is
print('hello'), and we accidentally forget one of the parentheses while
coding. A syntax error will happen, and this will stop the program
from running.

Portfolio: Universedeveloper.netlify.app | WhatsApp: +923181482800 | Lecturer: Zeeshan Hussain


RUN TIME ERROR
• Runtime errors happen as a user is executing your program.
• The code might work correctly on your machine, but on the
webserver, there might be a different configuration, or it might be
interacted with in a way that could cause a runtime error.

Portfolio: Universedeveloper.netlify.app | WhatsApp: +923181482800 | Lecturer: Zeeshan Hussain


LOGICAL ERROR
• A logical error occurs when the program compiles and runs but the
output is incorrect.
• These errors occur when the program's logic or algorithms are
incorrect.
• Logical errors are challenging to detect because the program does not
generate any error messages.

Portfolio: Universedeveloper.netlify.app | WhatsApp: +923181482800 | Lecturer: Zeeshan Hussain


COMMENTS IN PYTHON
• Comments are hints that we add to our code to make it easier to
understand. When executing code, Python's interpreter ignores
comments.
• For example, we have a program to print a text entered by the user.

Portfolio: Universedeveloper.netlify.app | WhatsApp: +923181482800 | Lecturer: Zeeshan Hussain


TYPES OF COMMENT
• let's understand the different types of comments in Python.
• Single line comment ( # )
• Multi line comments ( ‘’’ ‘’’ )
• Single Line: #this is a single line comment.

• Multi Line: ‘’’ this is a multi line comments, now I can write more
then one line comment at a time ‘’’.

Portfolio: Universedeveloper.netlify.app | WhatsApp: +923181482800 | Lecturer: Zeeshan Hussain


WHITE SPACE IN PYTHON
• Python uses indentation to define blocks of code.
• Indentation refers to the spaces or tabs at the beginning of lines of
code. These spaces indicate which lines of code belong to a particular
block, such as a loop, conditional statement, or function.
• For example:

Portfolio: Universedeveloper.netlify.app | WhatsApp: +923181482800 | Lecturer: Zeeshan Hussain


IF ANY QUESTION, YOU CAN
ASK!

Portfolio: Universedeveloper.netlify.app | WhatsApp: +923181482800 | Lecturer: Zeeshan Hussain


THANK YOU!

Portfolio: Universedeveloper.netlify.app | WhatsApp: +923181482800 | Lecturer: Zeeshan Hussain

You might also like