1.

Write a program in python to print a square of alternate numbers between the range of 1 to 10

Answer»

e:PythonNOTE: I'm PRINTING SQUARE of every 2ND NUMBER (alternating numbers) only. Program: for i in range(1,11,2): print (i * * 2)Output:19254981Explanation:range (1, 11, 2) will run a loop from 1 to 10 with a gap of 2. i * * 2 will RETURN the sqauare of numbers.



Discussion

No Comment Found