Python Code With Output
Python Code With Output
# 4. While-else loop
# Output:
# 0
# 1
# 2
# 0
i = 0
while i < 3:
print(i)
i += 1
else:
print(0)
count_file_content("ABC.text")
# 6. Fibonacci series
# Example Input: 5
# Output: 0 1 1 2 3
n = int(input("Enter number of terms: "))
a, b = 0, 1
for _ in range(n):
print(a, end=' ')
a, b = b, a + b