Intermediate Strings


Code Example1

a = 'hello'
b = a + 'there'
print (b)

Output

hellothere

becuz it not included space

a = 'hello'
#b = a + 'there'
#print (b)
c = a + ' ' + 'there'
print (c)
hello there

Question

  • What is the value of i in the following code?

      word = "bananana"
      i = word.find("na")
    
  • Ans

      2
    

Notes mentioning this note


ນີ້ຄືກຣາຟທີ່ລິ້ງໄປຫາທຸກໜ້າໃນ garden ນີ້ 🕸️.