Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Michael Krause
pytoy
Commits
ce64f872
Commit
ce64f872
authored
Dec 06, 2018
by
Michael Krause
🎉
Browse files
Add naturalsquares sequence
parent
330742f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
sequences.py
View file @
ce64f872
import
math
import
helpers
def
fibonacci
(
n
):
"""return frist n elements of the fibonacci sequence with seeds 0 and 1"""
...
...
@@ -6,3 +7,7 @@ def fibonacci(n):
for
i
in
range
(
n
-
3
):
res
.
append
(
res
[
-
1
]
+
res
[
-
2
])
return
res
def
naturalsquares
(
n
):
return
[
x
**
2
for
x
in
range
(
n
)]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment