Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
1.8 kB
0
Indexable
# num = int(input("Enter the number : "))
# if num > 1:
#     for i in range(2, int(num/2)+1):
#         if (num % i) == 0:
#             print(num, "is not a prime number")
#             break
#     else:
#         print(num, "is a prime number")
# else:
#     print(num, "is not a prime number")




# number = int(input('Enter a number:'))
# convertedNum = str(number)
# palindromeCheck = convertedNum[::-1]
# if convertedNum == palindromeCheck:
#     print("Yes")
# else:
#     print("No")

# NumList = []
# Even_Sum = 0
# Odd_Sum = 0
# Number = int(input("Enter the elements: "))
# for i in range(0, Number):
#     value = int(input("Please enter the Value of %d Element : " %i))
#     NumList.append(value)
#
# for j in range(Number):
#     if(NumList[j] % 2 == 0):
#        Even_Sum = Even_Sum + NumList[j]
# else:
#     Odd_Sum = Odd_Sum + NumList[j]
# print("Even sum =  ", Even_Sum)
# print("Odd Sum =  ", Odd_Sum)
#


# n = int(input("Enter The number of terms : "))
# first = 0
# second = 1
# print(first)
# print(second)
# # Calculating and printing the fibonacci series
# for i in range(1, (n-1)):
#     temp = first + second
#     first = second
#     second = temp
#     print(second)

# num = int(input("Enter a number: "))
# factorial = 1;
# for i in range(1,num+1):
#  factorial = factorial*i
# print("The factorial of",num,"is",factorial)

# def factorial(n):
#     if n == 0:
#         return 1
#     else:
#         return n * factorial(n-1)
# n = int(input("Input a number to compute the factiorial : "))
# print(factorial(n))

def fibonacci(number):
    first = 0
    second = 1
    print(first)
    print(second)
    for i in range(1, (number-1)):
         temp = first + second
         first = second
         second = temp
         print(second)


number = int(input("Input a number:"))
fibonacci(number)