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 ]

20120905c

shuffled

The random module's shuffle method mixes up (shuffles) the elements of a list in place, thus its return value is None. Because of this we cannot contract several operations, so for instance we cannot express easily the following: "shuffle the elements of the list and then return with the last element" ( the following doesn't work: random.shuffle(list1)[-1] ).

Exercise

Create a function called shuffled, which returns with the shuffled list, making an operation like this possible: shuffled(list1)[-1] . Make sure that shuffled() doesn't modify the original list! In this respect, it should be similar to sorted().

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 2021 April 26, 18:09