diff --git a/Fibonacci_Sequence_Generator/Fibonacci.py b/Fibonacci_Sequence_Generator/Fibonacci.py new file mode 100644 index 0000000..07dfa12 --- /dev/null +++ b/Fibonacci_Sequence_Generator/Fibonacci.py @@ -0,0 +1,23 @@ +def Fibbo_Sequence_Generator(): + # Generates a fibonacci sequence with the size of ngi + runFib = True + while(runFib): + n = int(input('How many numbers do you need? ')) + if n > 0 : + runFib = False + series = [1] + + while len(series) < n: + if len(series) == 1: + series.append(1) + else: + series.append(series[-1] + series[-2]) + + for i in range(len(series)): # Convert the numbers to strings + series[i] = str(series[i]) + else: + print('enter a valid number') + + return(', '.join(series)) # Return the sequence seperated by commas + +print(Fibbo_Sequence_Generator()) \ No newline at end of file diff --git a/Fibonacci_Sequence_Generator/README.md b/Fibonacci_Sequence_Generator/README.md new file mode 100644 index 0000000..87e2bce --- /dev/null +++ b/Fibonacci_Sequence_Generator/README.md @@ -0,0 +1,10 @@ +# Python Fibonacci Sequence Generator +This python script will ask you how many numbers do you need to see in the Fibonacci Sequence and generates the sequence based on your input. + +## Requirement +Python 3.xx + +## Running the script +```bash +python Fibonacci.py +``` \ No newline at end of file diff --git a/README.md b/README.md index a6c8551..2e41d1b 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,7 @@ So far, the following projects have been integrated to this repo: |[Excel Files Merger](Excel_Files_Merger) | [Andrei N](https://github.com/Andrei-Niculae)| |[Excel to List](Excel_to_ListofList) | [Nitish Srivastava](https://github.com/nitish-iiitd)| |[Extended_ip_address_info](extended_ip_address_info) | [hafpaf](https://github.com/hafpaf)| +|[Fibonacci_Sequence_Generator](Fibonacci_Sequence_Generator) | [John Wesley Kommala](https://github.com/JohnWesleyK)| |[File explorer](File-Explorer-Dialog-Box) | [Nikhil Kumar Singh](https://github.com/nikhilkumarsingh)| |[File Sharing Bot](File-Sharing-Bot) | [Darshan Patel](https://github.com/DarshanPatel11)| |[Flash card quizzer](Flash-card-Challenge) |[Utkarsh Sharma](https://github.com/Utkarsh1308) |