>>> '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
You should try to use the following ...READ MORE
Strings can be reversed using slicing. To ...READ MORE
To reverse a string in Python we ...READ MORE
You can also use the random library's ...READ MORE
colors = ['red', 'green', ...READ MORE
Enumerate() method adds a counter to an ...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
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.