Python Interviews: Difference between revisions
no edit summary
No edit summary |
No edit summary |
||
Line 142:
print raw_input().swapcase()
print(input().swapcase())
</pre>
* Arrays & Reverse them:
<pre>
>>> input ="1 2 3 4 -8 -10"
>>> arr=arr.split(' ')
>>> arr
['1', '2', '3', '4', '-8', '-10']
>>> arr[::-1]
['-10', '-8', '4', '3', '2', '1']
</pre>
|