Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Programování 1 pro matematiky
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Martin Mareš
Programování 1 pro matematiky
Compare revisions
8b07c25c3975f14cfb911303ec72e1c0ff8d3b15 to 1506577d729e9d1af8815bc24edffb6690719cf0
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
mj/prm1
Select target project
No results found
1506577d729e9d1af8815bc24edffb6690719cf0
Select Git revision
Swap
Target
mj/prm1
Select target project
mj/prm1
1 result
8b07c25c3975f14cfb911303ec72e1c0ff8d3b15
Select Git revision
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (2)
Fibonacci: Další řešení
· 98a425c8
Martin Mareš
authored
7 months ago
98a425c8
min3: Alternativní řešení
· 1506577d
Martin Mareš
authored
7 months ago
1506577d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
05-funkce/fibonacci.py
+14
-0
14 additions, 0 deletions
05-funkce/fibonacci.py
05-funkce/min3.py
+10
-0
10 additions, 0 deletions
05-funkce/min3.py
with
24 additions
and
0 deletions
05-funkce/fibonacci.py
View file @
1506577d
...
...
@@ -7,3 +7,17 @@ def fibonacci(n):
for
i
in
range
(
2
,
n
+
1
):
a
,
b
=
b
,
a
+
b
return
b
def
fibonacci2
(
n
):
fib
=
[
0
,
1
]
while
len
(
fib
)
<=
n
:
fib
.
append
(
fib
[
-
1
]
+
fib
[
-
2
])
return
fib
[
n
]
def
fibonacci3
(
n
):
if
n
<=
1
:
return
n
else
:
return
fibonacci3
(
n
-
1
)
+
fibonacci3
(
n
-
2
)
This diff is collapsed.
Click to expand it.
05-funkce/min3.py
View file @
1506577d
...
...
@@ -6,5 +6,15 @@ def min2(x, y):
else
:
return
y
def
min3
(
x
,
y
,
z
):
return
min2
(
min2
(
x
,
y
),
z
)
def
min3_alt
(
x
,
y
,
z
):
if
x
<=
y
and
x
<=
z
:
return
x
elif
y
<=
x
and
y
<=
z
:
return
y
else
:
return
z
This diff is collapsed.
Click to expand it.