Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

string -1 python

string = "Hello World"
#to index the final character of this string we would do
string[-1]
#this is useful when we dont know how long the string is going to be
#for example with user input
string = input("Enter a string: ")
last_character = string[-1]
Source by www.sololearn.com #
 
PREVIOUS NEXT
Tagged: #string #python
ADD COMMENT
Topic
Name
8+8 =