2. Types of programming languages
• Broadly, any programming language in the world can be classified into
2 types:
• Compiler based languages
• Interpreter based languages
• Parameters of differences between these types are: memory
required, time required, process of execution.
• No types is best. Depends on the application. Both have their own
advantages and disadvantages
3. Program compilation process
• The program source code passed to
compiler which compiles the code and
converts it to object file.
• At this stage, syntaxes, datatypes of
variables, function calls are checked.
• Object file contains binary code.
• This file is then linked with runtime
library files by the linker and converted
to executable file.
4. Difference between compiler and interpreter
• Compiler generates intermediate object code which further requires
linking.
• Therefore it takes more memory to store the object file.
• In Interpreter, no intermediate object code is generated.
• Compiler scans the entire program and translates it as a whole into
object code
• Interpreter translates the program one statement at a time.
5. • Compiler based languages are faster in execution as executable file is
already generated.
• Interpreter based languages are slower because they have to compile
and execute at runtime
9. Lets dive into python programming
• Get python on your laptop.
• Create virtual environment for python.
10. Steps for installing python
• Check if python is already installed :
• python3 –version
• Download Python for mac. Install it.
• Check the version of pip installed
11. Steps for creating virtual environment
• Install Pip. (Python Package Installer):
• sudo easy_install pip
• Install virtualenv
• sudo pip install virtualenv
• Navigate to where you want to store your code. You have two
options:
• cd ~/Desktop
• mkdir Development
• cd Development
• source venv/bin/activate
12. Basic syntax
• print : to print on command line
• Accepting input from command line:
• input()
• Store input from user:
• User_input = input()
• Printing Instructions for user to input :
• User_input = input(“Enter your height.”)
13. Comments in python
• # is a single line comment.
• “””….””” is multi line comment
14. Variable names rules
• A variable name must start with a letter or the underscore character
• A variable name cannot start with a number
• A variable name can only contain alpha-numeric characters and
underscores (A-z, 0-9, and _ )
• Variable names are case-sensitive (age, Age and AGE are three
different variables)
15. Quiz
• Go to slido.com
• Enter event code : V938
16. Output Variables
• The Python print statement is often used to output variables.
• To combine both text and a variable, Python uses the comma(,)
character: