Q:

print(p[2 , 3])...Choosing several alphabets at once

I have a string like this
p = "asfdasdf"

And want to check 3rd and 4th alphabets. So I tried
print(p[2 , 3])

but failed. What should I do to check several alphabets in strings at once?

A:

If I understand your question clearly, you want to substring a string correct?
What you have is almost correct just replace , with :
print(p[2:4])

A:

Use slices to get the 3rd and 4th alphabet, since in Python the base number is zero, we can reduce 3 and 4 to 2 and 3, and then execute the following code
#(3 + 1) because it will end at (n - 1), so use (n + 1) to stop at n 
print(p[2:(3+1)])
#or you can use print([2:4])

Using the most foolish way
print(p[2], p[3])

Using for statement (This is taking much code and time)
for i in p:
 if i == p[2] or i == p[3]:
  print(i, end='')
print('')

Using list comprehension (more faster than for statement, but more complex)
print(''.join([str(a) if a == p[2] or a == p[3] else '' for a in p]))

