II. DEBUG THE FOLLOWING
1. for a range(3, 0,1):
i=65
for b in (1, A+1)
print(ch(i),end)
i=+1
print()
Answers
Answer:
Thanks for free points
Given Code :
for a range(3, 0,1):
i=65
for b in (1, A+1)
print(ch(i),end)
i=+1
print()
Correct code :
for a in range(3, 0,1):
i=65
for b in (1, a+1) :
print(ch(i),end)
i=+1
print()
Extra information :
1) Program to find the factorial of a given number.
num = int(input("Enter a number: "))
factorial = 1
if num < 0:
print("Sorry, factorial does not exist for negative numbers")
elif num == 0:
print("The factorial of 0 is 1")
else:
for i in range(1,num + 1):
factorial = factorial*i
print("The factorial of",num,"is",factorial)
2) Program to find the reverse of a given number.
num = int(input("Enter a number: "))
R=0 while (num!=0):
rem = num%10
R = R*10+rem
num = num//10
print(R)