Docsity
Docsity

Prepara i tuoi esami
Prepara i tuoi esami

Studia grazie alle numerose risorse presenti su Docsity


Ottieni i punti per scaricare
Ottieni i punti per scaricare

Guadagna punti aiutando altri studenti oppure acquistali con un piano Premium


Guide e consigli
Guide e consigli


Python Keywords, Schemi e mappe concettuali di Informatica gestionale

Una lista di parole chiave del linguaggio di programmazione Python, con una breve descrizione di ciascuna. Le parole chiave includono 'if', 'else', 'return', 'class', 'import', 'break', 'continue', 'for', 'while', 'and', 'or', 'in', 'is', 'not', 'pass', 'del', 'try', 'except'. Il documento può essere utile come riassunto per uno studente che sta imparando Python o come riferimento rapido per un programmatore esperto.

Tipologia: Schemi e mappe concettuali

2020/2021

In vendita dal 22/06/2022

rebeccacordioli
rebeccacordioli 🇮🇹

5

(1)

28 documenti

1 / 1

Toggle sidebar

Questa pagina non è visibile nell’anteprima

Non perderti parti importanti!

bg1
NAME STRUCTURE KIND WHAT IT DOES NOTE
False - boolean boolean expression
True - boolean boolean expression
elif
if condition1:
statement1…
elif condition2:
statement2…
else:
statement3
condition
if the condition1 is true it
executes the statement1, if the
condition2 it executes the
statement2, otherwise it
executes statement3
else
if condition:
statement1…
else:
statement2…
condition
if the condition is true it
executes the statement1,
otherwise it executes
statement2
if
if condition:
statement1
statement2
condition
if the condition is true it
executes the statements
return return value define
it exits the function at that point
and return the results of "value"
class
class
class_name(par
ameters):
define
it defines a class
def
def
function_name(
parameters):
define
it defines a function or method
of a class
parameters can be absent (); you
can have a default parameter if
you use the =
import
import module import
it imports modules that are not
built-in
break break iteration
interrupts a loop when a a
specific condition occurs
it's used with "while" and "for"
continue continue iteration
move to the next loop iteration
when a specific contition occurs
it's used with "while" and "for"
for
for variable in
[a,b,c…]:
statement1
statement2…
iteration
it creates a loop controlled by a
counter
it executes the statements for
each value of the variable included
in the sequence
while
while condition:
statement1
statement2…
iteration
it executes the statements as
long as the condition is true
if the loop is infinite use "while
True" and then and "if"+condition
with "break"
and x and y operator
it returns true if both x and y are
true
in
x in y operator
it checks if an element is in a
sequence or container
is x is y operator
it checks that 2 objects are the
same in memory
if you just have to check the
equality use ==
not not x operator if returns true if x is false
or x or y operator
it returns true if either x or y is
true
pass pass other
acts as a marker for the code
which is going to be completed,
avoiding that incomplete
constructs return an error
when we want to test the program
or go along with the next
statements, without concluding a
certain part
del del object other
it deletes an object or part of an
object
its common use is to remove
indexes from a list or dictionary
try … except
try:
statements
except:
statements
other
it tries to perform an action
except if a (specified) error
occurs
you can use multiple "except"
PYTHON KEYWORDS

Anteprima parziale del testo

Scarica Python Keywords e più Schemi e mappe concettuali in PDF di Informatica gestionale solo su Docsity!

NAME STRUCTURE KIND WHAT IT DOES NOTE

False - boolean boolean expression True - boolean boolean expression elif if condition1: statement1… elif condition2: statement2… else: statement3 condition if the condition1 is true it executes the statement1, if the condition2 it executes the statement2, otherwise it executes statement else if condition: statement1… else: statement2… condition if the condition is true it executes the statement1, otherwise it executes statement if if condition: statement statement2 condition if the condition is true it executes the statements return return value define it exits the function at that point and return the results of "value" class class class_name(par ameters): define it defines a class def def function_name( parameters): define it defines a function or method of a class parameters can be absent (); you can have a default parameter if you use the = import import module^ import it imports modules that are not built-in break break iteration interrupts a loop when a a specific condition occurs it's used with "while" and "for" continue continue iteration move to the next loop iteration when a specific contition occurs it's used with "while" and "for" for for variable in [a,b,c…]: statement statement2… iteration it creates a loop controlled by a counter it executes the statements for each value of the variable included in the sequence while while condition: statement statement2… iteration it executes the statements as long as the condition is true if the loop is infinite use "while True" and then and "if"+condition with "break" and x and y operator it returns true if both x and y are true in x in y^ operator it checks if an element is in a sequence or container is x is y operator it checks that 2 objects are the same in memory if you just have to check the equality use == not not x operator if returns true if x is false or x or y operator it returns true if either x or y is true pass pass other acts as a marker for the code which is going to be completed, avoiding that incomplete constructs return an error when we want to test the program or go along with the next statements, without concluding a certain part del del object other it deletes an object or part of an object its common use is to remove indexes from a list or dictionary try … except try: statements except: statements other it tries to perform an action except if a (specified) error occurs you can use multiple "except"

PYTHON KEYWORDS