characters = 4 string = "This is a string" print(string[:characters]) #output: 'This'
string = "Hello world" string[:3] # -> Hel
first_chars = sample_str[0:4]