Generate the list 'k4' having numbers from 100 to 1 in decreasing order, which are also multiple of 25 in python
Answers
Answered by
1
The code for generating a list k4 which should contain numbers from 100 to 1 in decreasing order which are also multiples of 25 is as follows.
But before creating the logic for the code, we need to understand that numbers below 25 can't be multiples of 25 so we need to start our counter from 100 and decrease it's value upto 25.
t4=[]
for x in range(100,24,-1):
if x%25==0:
t4.append(x);
Answered by
3
k4=list(range(100,0,-1*25))
print(k4)
Similar questions