Recent Changes - Search:

Oktatás

* Programozás 2
  + feladatsor
  + C feladatsor
  + Python feladatsor
  + GitHub oldal

* Szkriptnyelvek
  + feladatsor
  + quick link

* levelezősök
  + Adator. prog.
  + feladatsor
  + quick link

teaching assets


Félévek

* 2024/25/1
* archívum


Linkek

* kalendárium
   - munkaszüneti napok '20
* tételsorok
* jegyzetek
* szakdolgozat / PhD
* ösztöndíjak
* certificates
* C lang.
* C++
* C#
* Clojure
* D lang.
* Java
* Nim
* Scala


[ edit | logout ]
[ sandbox | passwd ]

20120904b

reverse a part of a list

Having a list, reverse a part of it. For instance, consider the list [1, 2, 9, 6, 5], and reverse its last three elements, which gives the list [1, 2, 5, 6, 9].

Solve the problem in a general way. Complete the following code snippet:

a = [1, 2, 9, 6, 5]
i = 2      # start reversing from this index position
j = 4      # reverse until this position (but this position is included)
...        # magic happens
print a    # [1, 2, 5, 6, 9]
Cloud City

  

Blogjaim, hobbi projektjeim

* The Ubuntu Incident
* Python Adventures
* @GitHub
* heroku
* extra
* haladó Python
* YouTube listák


Debrecen | la France


[ edit ]

Edit - History - Print *** Report - Recent Changes - Search
Page last modified on 2015 June 27, 16:32