Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Array Indexing and Printing in Python (pyCharm)

In main.py, I am having a hard time printing the palindrome of a string. 

When I run the commands: print("Hello"), it works

When I run: 

s="Hello"

print(s), it works

When I run: 

print(s[0:4]), it works

BUT!

print(s[4:0]) shows nothing on the command console. 

Is that the correct syntax for storing the "inverse" of a list? Why would it not print? 

I'm using pyCharm and writing the code in main.py and running it. 

Thanks!


0 Answer
Advertisements

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.