In: Computer Science
A.) 1. Write a loop that prints the numbers 1-25i.e.
B.) 1 2 3 4... 252. Write a loop that prints all the even numbers between 1 and 50i.e. 2 4 6 8... 483.
C.) Create a list of the following fruits: oranges, apples, grapes and mangos and cherries. Write a loop that prints out every other fruit starting with oranges.i.e. oranges grapes and cherries.
#(a) part...
for i in range(1,26): #range start from 1 to 25..
print(i,end=" ") #print number and
using end=" " will print number in same line...
print()
#(b) part....
for i in range(1,51): #from 1 to 50...
if(i%2==0): #we will check if number
is divisible by 2....
print(i,end=" ") #will
print even number..
print()
#(c) part...
l=['ornages','apples','grapes','mangos','cherries'] #list
for i in
range(0,len(l),2):
#will start from 0 to len(l) but increment is 2...
print(l[i],end="
")
# print list...
print()
#will change line..
#########################################################