>>> 'hello world'[::-1]
This is extended slice syntax.
Syntax is as follows:
[begin:end:step] - by leaving begin and end off and specifying a step of -1, it reverses a string.
>>> 'hello world'[::-1] 'dlrow olleh'
This is ...READ MORE
How to reverse a string in Python? READ MORE
for c in "string":
You can use word.find('o') as well to ...READ MORE
You can also use the random library's ...READ MORE
colors = ['red', 'green', ...READ MORE
can you give an example using a ...READ MORE
You can simply the built-in function in ...READ MORE
There are different method to implement stack ...READ MORE
The simple way of doing this will ...READ MORE
Already have an account? Sign in.