forked from rahulcodes51/python-programes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfibonacci.py
More file actions
27 lines (19 loc) · 685 Bytes
/
Copy pathfibonacci.py
File metadata and controls
27 lines (19 loc) · 685 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#program to fibobacci series
#concept of the program:
""" first two values are taken from the user and they are added in a new variable
and the values of value a and value b are swapped to produce the number.."""
def fibo(num1,num2):
#printing the first and second value..
print(num1,end=" ")
print(num2,end=" ")
for i in range(1,10):
num3=int(num1+num2)#new variable
#swapping the values
num1=num2
num2=num3
#printting the result :)
print(num3,end=" ")
#inputs and calling the function
num1=int(input("enter the number: "))
num2=int(input("enter the second value: "))
fibo(num1,num2)