Write programs for the following:
(a) 1,4,9,16...n terms
(b)1,2,4,7,11...n terms
(c) 3,6,9,12..n terms
(d) 1,5,3,0,4,5,6,0...n terms
Answers
Answered by
6
Answer:
The python codes are:
a)
_____________________________________
n=int(input("Enter a value: "))
for i in range(1,n+1):
print(i**2, end=" ,")
_____________________________________
b)
___________________________________
n=int(input("Enter a value: "))
a=1
for i in range(0,n):
a+=i
print(a, end=",")
_____________________________________
c)
_____________________________________
n=int(input("Enter a value: "))
for i in range(1,n+1):
print(i*3, end=" ,")
_____________________________________
d)
_____________________________________
n=int(input("Enter a value: "))
for i in range(1,n+1):
print(i*15, end=" ,")
_____________________________________
Answered by
2
Explanation:
thanks for freeeee points
Similar questions