Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

INF

Rating
-
Sold
-
Pages
23
Grade
A+
Uploaded on
24-01-2021
Written in
2021/2022

INF1511 EXAM PREP NOTES AND 2017 EXAM PAPER WITH ANSWERS

Institution
Course

Content preview

INF1511
EXAM PREP NOTES

,Chapter 1 Python and Its Features
1. Introduction
Python is a powerful high-level, dynamic object-oriented programming that is implemented in C, and
relies on the extensive portable C libraries.

Python is an interpreted programming language, which means that it can be executed by the computer
without compiling. Compiling is the conversion of a programing language into machine instructions that
can then be executed by the computer.

C is a general-purpose, computer programming language, supporting structured programming.

The implementation of Python studied in the course is called CPython, or Classic Python (often just called
Python) other implementations are Jthon and IronPython.


2. Using Python

Python can be used on through the command line

The command line is used to execute one line of Python code at a time. Note that the commands
executed this way cannot be saved.




To ensure that Python can be executed from any folder on a computer, the Path variable in the
Environmental Variables must be updated with the path of the Python installation.

Or the IDLE IDE

, The IDLE enables the programmer to save Python code in a file and execute all the code at once. One can
edit, debug and preview code in the IDLE.




3. Basic Elements in a Program
Programs consist of the following basic elements, a collection of literals, variables, and keywords.

Literals

A literal is a number or string that appears directly in a program, e.g.

10 # Integer literal
10.50 # Floating-point literal
'Hello' # String literal
"World!" # String literal
'''Hello World!
It might rain today # Triple-quoted string literal
Tomorrow is Sunday'''

In Python, you can use both single and double quotes to represent strings. The strings that run over
multiple lines are represented by triple quotes.

Variables
Variables are used for storing data in a program. E.g.
l = 10
Length = 10
k= "Hello World!"

a = True # Boolean variable
b = [2, 9, 4] # List variable
c = ('apple', 'mango', 'banana') # tuple variable
A tuple in python language refers to an ordered, immutable (non-
changeable) set of values of any data type.

Keywords

Written for

Institution
Course

Document information

Uploaded on
January 24, 2021
Number of pages
23
Written in
2021/2022
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$3.04
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
StudyBuddyUnisa University of South Africa (Unisa)
Follow You need to be logged in order to follow users or courses
Sold
304
Member since
5 year
Number of followers
177
Documents
64
Last sold
9 months ago
Study Buddy

4.8

114 reviews

5
101
4
8
3
4
2
0
1
1

Trending documents

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions