Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
forelesning
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sebastian Kemp-Jacobsen
forelesning
Commits
d2041b67
Commit
d2041b67
authored
2 years ago
by
Børge Haugset
Browse files
Options
Downloads
Patches
Plain Diff
forelesning
parent
6e1a2551
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
uke38/Python/pensum_uke38.py
+6
-2
6 additions, 2 deletions
uke38/Python/pensum_uke38.py
with
6 additions
and
2 deletions
uke38/Python/pensum_uke38.py
+
6
−
2
View file @
d2041b67
...
...
@@ -28,6 +28,7 @@ Hvorfor funksjoner?
'''
'''
# Første linje:
'
funksjonshode
'
- husk parenteser og kolon!
def funksjonsnavn(innparameter1, innparameter2): # 1 og 41 blir her parametre
# kodeblokk med ting en må gjøre for å komme til svaret
...
...
@@ -42,6 +43,9 @@ def gange(tall1, tall2):
print(f
'
2*3 = {gange(2,3)}
'
)
'''
# Dagens plan:
# Flere funksjoner:
...
...
@@ -54,7 +58,7 @@ print(f'2*3 = {gange(2,3)}')
# - legg merke til at bruken av samme variabelnavn
# - legg merke til at funksjonen kjenner til navn
# - legg merke til at kode utenfor en funksjon ikke kjenner til en inni!
# Vis ppt-siden med skoping,
Terje side 4 fra uke 39
# Vis ppt-siden med skoping,
ppt s.22
# Oppgave:
# Åpne oppgave_funksjoner.py
...
...
@@ -62,7 +66,7 @@ print(f'2*3 = {gange(2,3)}')
# Globale variable:
# Sjekk ut global_variabl.py
# ppt
Terje s6 uke 39
# ppt
s.33 elns.
# Biblioteker
# Se matte_bibliotek.py
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment