100% de satisfacción garantizada Inmediatamente disponible después del pago Tanto en línea como en PDF No estas atado a nada 4.2 TrustPilot
logo-home
Resumen

Beknopte wet. programmeren samenvatting (PYTHON)

Puntuación
-
Vendido
-
Páginas
14
Subido en
25-09-2024
Escrito en
2023/2024

Dit document bevat een samenvatting van het vak wetenschappelijk programmeren in de programmeertaal Python. Het bevat formules, redeneringen, voorbeelden, ... . De inhoud staat vermeld per PC lab.

Institución
Grado









Ups! No podemos cargar tu documento ahora. Inténtalo de nuevo o contacta con soporte.

Escuela, estudio y materia

Institución
Estudio
Grado

Información del documento

Subido en
25 de septiembre de 2024
Número de páginas
14
Escrito en
2023/2024
Tipo
Resumen

Temas

Vista previa del contenido

Wetenschappelijk programmeren: pyhton
PC lab 1
7 ---> int
➔ ASCII
7.8 ---> float
“sqldngoi” ---> str -> built in gegevenstype
B = True (=1) / Falsee (=0) ---> bool
List = [ B, “a”, 8, -16.13 ]

Operatoren: (vanaf 1 float => resultaat ook float)

- Op int en float:
o +;-;*; /
o ** ---> machtsverheffing
o // ---> gehele deling
o % ---> rest na deling
- Op str: a = ‘mooi’ ; b = ‘weer’
o a + b ---> concatenatie ~~~> ‘mooiweer’
o a*3 ---> duplicatie ~~~> ‘mooimooimooi’
- op bool:
o and, not x, or
o <, <=, >, >=, !=, ==
- Logische operatoren: &, |, ^, ~

Ingebouwde functies:

- Len() --> # karakters
- Pow(x, 2) ---> x tot de tweede macht
- Round(3.14159, 2) ---> afronden 2 getallen na komma
- Max(x,y,z) // Min(x,y,z) ---> max // min v argumenten
- Abs(-6298) ---> absolute waarde
- Range(6,36,2) ---> van 6 tem 35 in stappen v 2 (start, stop, step)
- Help() ---> functiedocumentatie weergeven
- Print()
o Sep = “-“*10
o End = “!” ; end = “\n” ---> nieuwe regel
- Andere: tabel 3.4 (p62 op computer)

Aliasing:

- a=2 ; a=b => b = 2 (garbage collection)

Expressie  statement met a = 8

- Expr: 8 + 3*4 log expr: a > 2
- Stat: res1 = a + 3*a -2 res2 = a < 2 (---> False)

Modules:

- Import math: (3.6.2)
o Math.sqrt()

, o Math.sin()
o …
- Import random (3.6.3)
o Random.randit(1,6) ---> random getallen tss 1 en 6
- Import numpy
o numpy.mean([2,4,9]) = gem v 2,4,9 = 15/3 = 5
o Eenv: import numpy spec: from numpy import mean met alias: import
numy as np

Typeconversies:

- Type() ---> gegevenstype opvragen: int / float / str / bool
- Bij input: gegstype = str
- Float -> str // int -> float // int -> str
- Float -> int ~~~> afronden naar 0
- Str -> float/int ~~~> niet altijd mogelijk



PC lab 2
If-elif-else:

- If LE1:
Uit te voeren code ----> als LE1 = True (stopt hier: gaat niet verder nr elif,
programma stopt wnr 1e criterium voldaan is => met negatieve werken)
- Elif LE2:
Uit te voeren als LE1 = False en LE2 = True
- …
- Else:
Uit te voeren als alles hierboven = False
- Kan genest w

While(-else):

- While LE:
Code die herhaaldelijk uitgevoerd w zolang LE = True
Else:
Code die 1x uitgevoerd w als False bij while
(als 1 keer totaal printen: uit while-lus ; als iedere keer printen: in while-lus)
(vaak in while lus opnieuw vraag stellen zodat lus blijft doorgaan)
- Som v getallen: getal = (2)
som = 0 (teller initialiseren vóót wihile-lus)
while ???: (waaraan het moet voldoen)
som = som + getal
getal = getal + (stappen waarin je gaat)
- Alles in lus moet aan de VOORWAARDE voldoen
- Als nooit = False => oneindige lus (stoppen: scripts -> CNTRL-SHIFT-C ; interactive:
interrupt/restart)
- Kan genest w
- Stopt als ‘exact’/’break’ ingegeven w
$5.38
Accede al documento completo:

100% de satisfacción garantizada
Inmediatamente disponible después del pago
Tanto en línea como en PDF
No estas atado a nada

Conoce al vendedor
Seller avatar
biobroeder

Conoce al vendedor

Seller avatar
biobroeder Universiteit Gent
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
0
Miembro desde
1 año
Número de seguidores
0
Documentos
6
Última venta
-

0.0

0 reseñas

5
0
4
0
3
0
2
0
1
0

Recientemente visto por ti

Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes