100% tevredenheidsgarantie Direct beschikbaar na je betaling Lees online óf als PDF Geen vaste maandelijkse kosten
logo-home
Summary INF1511 €2,59
In winkelwagen

Samenvatting

Summary INF1511

 1 keer verkocht
  • Vak
  • Instelling

INF1511 is a challenging module therefore students are advised to use this document as it will be helpful for their assignments and exams preparations.

Voorbeeld 3 van de 22  pagina's

  • 18 januari 2021
  • 22
  • 2020/2021
  • Samenvatting
avatar-seller
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

, Python has 30 keywords: ensure you’re familiar with the ones used in the textbook examples and
assignments.

Comments
These are preceded by #, they are ignored by the interpreter and are used to make the code more
readable.

Continuation Lines

Two types of lines in Python are called physical (e.g. the 7 lines in
the code below.
A logical line is a combination of several physical lines, e.g. line 2,
3 and 4.

1. print (10)
2. print ('Hello World! \
3. It might rain today. \
4. Tomorrow is Sunday.')
5. print ('''Hello World!
6. It might rain today.
7. Tomorrow is Sunday.''')


Check page 33 of the textbook for the ways in which physical lines can be joined into one logical line.

Printing

print (["message"][variable list])

The print statement above prints the string in message and a list of variables in the optional variable list.

Dit zijn jouw voordelen als je samenvattingen koopt bij Stuvia:

Bewezen kwaliteit door reviews

Bewezen kwaliteit door reviews

Studenten hebben al meer dan 850.000 samenvattingen beoordeeld. Zo weet jij zeker dat je de beste keuze maakt!

In een paar klikken geregeld

In een paar klikken geregeld

Geen gedoe — betaal gewoon eenmalig met iDeal, creditcard of je Stuvia-tegoed en je bent klaar. Geen abonnement nodig.

Direct to-the-point

Direct to-the-point

Studenten maken samenvattingen voor studenten. Dat betekent: actuele inhoud waar jij écht wat aan hebt. Geen overbodige details!

Veelgestelde vragen

Wat krijg ik als ik dit document koop?

Je krijgt een PDF, die direct beschikbaar is na je aankoop. Het gekochte document is altijd, overal en oneindig toegankelijk via je profiel.

Tevredenheidsgarantie: hoe werkt dat?

Onze tevredenheidsgarantie zorgt ervoor dat je altijd een studiedocument vindt dat goed bij je past. Je vult een formulier in en onze klantenservice regelt de rest.

Van wie koop ik deze samenvatting?

Stuvia is een marktplaats, je koop dit document dus niet van ons, maar van verkoper wwwstuviaacza. Stuvia faciliteert de betaling aan de verkoper.

Zit ik meteen vast aan een abonnement?

Nee, je koopt alleen deze samenvatting voor €2,59. Je zit daarna nergens aan vast.

Is Stuvia te vertrouwen?

4,6 sterren op Google & Trustpilot (+1000 reviews)

Afgelopen 30 dagen zijn er 64670 samenvattingen verkocht

Opgericht in 2010, al 15 jaar dé plek om samenvattingen te kopen

Begin nu gratis

Laatst bekeken door jou


€2,59  1x  verkocht
  • (0)
In winkelwagen
Toegevoegd