Skip to content

Commit 816a3a0

Browse files
Create fibonacci_SIMPLIFIED
A program concentrated at beginners to learn applying for loops and logic to get a fibonacci series till nth element
1 parent e057209 commit 816a3a0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

fibonacci_SIMPLIFIED

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
#printing fibonnaci series till nth element - simplified version for begginers
3+
def print_fibonacci(n):
4+
current_no = 1
5+
prev_no = 0
6+
for i in range(n):
7+
print(current_no, end = " ")
8+
prev_no,current_no = current_no, current_no + prev_no
9+
10+
print_fibonacci(10)

0 commit comments

Comments
 (0)