TK2053 Programming Paradigm - Python Interpreter PDF

Summary

This document describes programming with Python, introducing the language and its key features. It covers installing Python and using the interpreter. The document also explains programming fundamentals, such as comments and indentation.

Full Transcript

TK2053 PROGRAMMING PARADIGM Script Programming with Python - Python Interpreter 2 Python Programming Language Developed in the early 1990’s by Guido van Rossum. Python 2 is the past, and Python 3 is the future....

TK2053 PROGRAMMING PARADIGM Script Programming with Python - Python Interpreter 2 Python Programming Language Developed in the early 1990’s by Guido van Rossum. Python 2 is the past, and Python 3 is the future. We will be using Python 3 in this course. Good general-purpose, high-level language (readable). Important: Python documentation at https://docs.python.org/3/ Fun fact: The name “Python” is derived from Guido van Rossum’s favourite TV show “Monty Python’s Flying Circus” Guido van Rossum. Image from Wikipedia 3 Getting Started Before we can begin, we need to actually install Python https://www.python.org/downloads/ Throughout this course, we will be using IDLE as the integrated development environment in this course. The first thing you should do is download, install and write your first Python program. Refer to TK2053_Python_Lab0. 4 Python Interpreter Python is an interpreted language There are two ways to run a Python program: - Interactive interpreter a program that allows the user to execute one line of code at a time - Python file (.py file) store Python program in text files and run them 5 Python Interpreter DEMO 6 Some Fundamentals Whitespace is significant in Python. Other languages may use {} or (), Python uses indentation to denote code blocks Comments To express information that cannot be expressed in code Single-line comments denoted by # Multi-line comments begin and ends with three “ Typically multi-line comments are meant for documentation

Use Quizgecko on...
Browser
Browser