CBSE Class 11 Computer Science
Question 19 of 22
Introduction to Python Modules — Question 19
Back to all questionsdef
print_fibonacci
(
n
):
a
,
b
=
0
,
1
while
a
<=
n
:
print
(
a
,
end
=
' '
)
a
,
b
=
b
,
a
+
b
n
=
int
(
input
(
"Enter a number: "
))
print_fibonacci
(
n
)
Output
Enter a number: 10
0 1 1 2 3 5 8