# Python хэл дээрх мөрийг давтахын тулд "for...in" тэмдэглэгээг ашиглана.
str = "hello"
for c in str:
print(c)
# h
# e
# l
# l
# o
for i in "Hello":
print(i)
# Iterating through a string
count = 0
for letter in 'Hello World':
if(letter == 'l'):
count += 1
print(count,'letters found')
for letter in "Python":
print(letter)
word = "test"
for letter in word:
print(letter)
mystring = "Hello Python"
# getting length of string
lengthOfmystring = len(mystring)
# Iterating the index
for var in range(lengthOfmystring):
print("Element of string:" , mystring[var])
mystring = "Hello python";
for ch in mystring:
print("Index of Element :", mystring.index(ch) , " - Element of string:",ch)