A community for students.
Here's the question you clicked on:
 0 viewing
Don.Shehab
 2 years ago
hello , using python v.3 , i tried to merge those two functions
.sort()
.reverse()
into one line .sort()=(reverse=true)
but it doesn't execute , what would be the problem ?
Don.Shehab
 2 years ago
hello , using python v.3 , i tried to merge those two functions .sort() .reverse() into one line .sort()=(reverse=true) but it doesn't execute , what would be the problem ?

This Question is Open

msmithhnova
 2 years ago
Best ResponseYou've already chosen the best response.0I am not sure what you are trying to do and the above line does not make sense. If you have a list of say L=[3,2,1,4] and do L.sort() L will now be [1,2,3,4]. If you do L.reverse() on the original list you will get [4,1,2,3]. If you wanted to compare if doing both are the same it would be more like. L=[3,2,1,4] Lsort = L[:] Lsort.sort() Lrev = L[:] Lrev = Lrev.reverse() if Lsort == Lrev: print 'True' else: print 'False'
Ask your own question
Sign UpFind more explanations on OpenStudy
Your question is ready. Sign up for free to start getting answers.
spraguer
(Moderator)
5
→ View Detailed Profile
is replying to Can someone tell me what button the professor is hitting...
23
 Teamwork 19 Teammate
 Problem Solving 19 Hero
 Engagement 19 Mad Hatter
 You have blocked this person.
 ✔ You're a fan Checking fan status...
Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.