Professional Documents
Culture Documents
STD 8 Python New
STD 8 Python New
STD 8 Python New
n=int(input("Enter number:"))
count=0
while(n>0):
count=count+1
n=n//10
Output:
Enter number:1234
factorial = 1
if n>=1:
factorial= factorial * i
Output:
Enter a number:5
b=1
c=0
if N < 0:
print("Invalid input")
elif N == 0:
print("0")
elif N == 1:
print("0\n1")
else:
print("0\n1 ")
for i in range(N-1):
c=a+b
print(c)
a=b
b=c
Output:
Enter Number = 5
3
5
temp = x
x=y
y = temp
Output:
Enter value of x: 12
Enter value of y: 34