>>> descending([]) True >>> descending([4,4,3]) True >>> descending([19,17,18,7]) False | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

>>> descending([]) True >>> descending([4,4,3]) True >>> descending([19,17,18,7]) False

>>> descending([]) True >>> descending([4,4,3]) True >>> descending([19,17,18,7]) False def valley(l): if (len(l)//2==0): return "False" m=len(l)//2 s=[] k=[] i=0 while i<=m: s.append(l(i)) i=i+1 s.append(l(m)) for j in range(len(l),m,-1): k.append(l(j)) while b<len(s): h=b if s[h]==j[h]: b=b+1 else: return "False" return "True" print(valley([1,2,3,1]))

17th Feb 2019, 9:33 AM
Shaik Abeedh
Shaik Abeedh - avatar
1 Answer
+ 6
Is that a question? If you want to share a code you have trouble with, please upload the code to the code playground and post a link here. And please don't forget the question. You probably need to replace all "True"/"False" with True/False (no quotes) https://www.sololearn.com/Discuss/1316935/welcome-to-sololearn-forum/
17th Feb 2019, 10:02 AM
Anna
Anna - avatar