Welcome To Snipplr
Everyone's Recent Python Snippets Tagged array
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
« Prev 1 Next »
arr[::-1] does a list slice to reverse the array
str(x) for x in arr[::-1] casts the ints in the array as strings
map(str, arr[::-1]) does the same thing by using map to cast the ints
" ".join() joins the resulting strings with a space
1
951
posted 7 years ago by denisemauldin
I am tired of having to go through text and adding quotation marks and commas to strings or just commas after numbers... f-that. Fixed.
0
772
posted 9 years ago by joshuaherman
« Prev 1 Next »