You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
interactive, collaborative course sites that instructors can maintain with
59
-
minimal effort
60
-
- {{< iconify fa6-solid diagram-project >}} **Next Steps**: Give examples of
61
-
content you can immediately use! See `https://github.com/GatorEducator/PyCon2025-EducationAndTypingSummit-Presentations` for more details!
55
+
- {{< iconify fa6-solid lightbulb >}} **Ultimate Goal**: Build content-focused, interactive, collaborative course sites that instructors can maintain with minimal effort
56
+
- {{< iconify fa6-solid diagram-project >}} **Next Steps**: Give examples of content you can immediately use! See [Algorithmology.org](https://algorithmology.org/) for more details!
62
57
63
58
:::
64
59
65
-
## Explore Use of the `LinkedList`
60
+
## Interactive Fibonacci Sequence
66
61
67
62
```{pyodide}
68
63
#| autorun: true
69
64
#| max-lines: 10
70
-
class ListNode:
71
-
def __init__(self, data, link = None):
72
-
self.data = data
73
-
self.link = link
74
-
75
-
class LinkedList:
76
-
def __init__(self):
77
-
self._head = None
78
-
79
-
def addfirst(self, item):
80
-
self._head = ListNode(item, self._head)
81
-
82
-
def addlast(self, item):
83
-
if self._head is None:
84
-
self.addfirst(item)
85
-
else:
86
-
currentnode = self._head
87
-
while currentnode.link is not None:
88
-
currentnode = currentnode.link
89
-
currentnode.link = ListNode(item)
90
-
91
-
def removefirst(self):
92
-
item = self._head.data
93
-
self._head = self._head.link
94
-
return item
95
-
96
-
def removelast(self):
97
-
if self._head.link is None:
98
-
return self.removefirst()
99
-
else:
100
-
currentnode = self._head
101
-
while currentnode.link.link is not None:
102
-
currentnode = currentnode.link
103
-
item = currentnode.link.data
104
-
currentnode.link = None
105
-
return item
106
-
107
-
LL = LinkedList()
108
-
LL.addfirst(3)
109
-
LL.addfirst(5)
110
-
print(LL.removefirst() == 5)
111
-
LL.addlast(9)
112
-
LL.addlast(13)
113
-
print(LL.removefirst() == 3)
114
-
print(LL.removefirst() == 9)
115
-
print(LL.removelast() == 13)
65
+
def fibonacci(n):
66
+
"""Calculate the Fibonacci sequence up to n terms."""
0 commit comments