Computer Science, asked by koppulasoumya1819, 4 days ago

Given a list of numbers, this is how Andy like to slice it:

If the length of the list is even, extract the n elements from the start
If the length of the list is odd, extract n elements from the end
Here, n denoted the half of the length of the given list.
def solve(Andy_list):


d=int(len(Andy_list)/2)

if(len(Andy_list)%2==0):

return (Andy_list[0:d])

else:

return (Andy_list[-d:])

Answers

Answered by bahadamajhi2014
0

Answer:

nnjjki in good condition of good Evening you can find more good news channel name in my very own jewelry box with s to the wii

Similar questions