From 816a3a02cf86a518551ceac58816c078cba5ac52 Mon Sep 17 00:00:00 2001 From: Anonymous InfoBro <132287085+IntelligentInfoBro@users.noreply.github.com> Date: Wed, 15 Nov 2023 17:52:00 -0800 Subject: [PATCH] Create fibonacci_SIMPLIFIED A program concentrated at beginners to learn applying for loops and logic to get a fibonacci series till nth element --- fibonacci_SIMPLIFIED | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 fibonacci_SIMPLIFIED diff --git a/fibonacci_SIMPLIFIED b/fibonacci_SIMPLIFIED new file mode 100644 index 00000000000..77f6854050f --- /dev/null +++ b/fibonacci_SIMPLIFIED @@ -0,0 +1,10 @@ + +#printing fibonnaci series till nth element - simplified version for begginers +def print_fibonacci(n): + current_no = 1 + prev_no = 0 + for i in range(n): + print(current_no, end = " ") + prev_no,current_no = current_no, current_no + prev_no + +print_fibonacci(10)