DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
get first x characters of string python
characters = 4 string = "This is a string" print(string[:characters]) #output: 'This'
PREVIOUS
NEXT
Tagged:
#characters
#string
#python
ADD COMMENT
Topic
COMMENT
Name
6+2 =
Submit