Recent Changes - Search:

Oktatás

* Programozás 1
  + feladatsor
  + GitHub oldal

* Szkriptnyelvek
  + feladatsor
  + quick link

Teaching

* Programming 1 (BI)
  ◇ exercises
  ◇ quick link

* Scripting Languages
  ◇ exercises
  ◇ quick link

teaching assets


Félévek

* aktuális (2023/24/2)
* 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 here
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 2017 August 04, 11:54