Advertisement
nux95

Untitled

Nov 28th, 2011
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1.  
  2. public String niceList(PythonListWhichIsNotAvailableInJava_Lol list) {
  3. String full = "[";
  4. for (String item: list) { // iterate over all items in the list
  5. full += item + ", ";
  6. }
  7. return full + "]";
  8. }
  9.  
  10. def niceList(list_): # doesn override the built-in `list`
  11. full = ""
  12. for item in list_:
  13. full += str(item) + ", "
  14. return full + "]"
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement