Created
February 6, 2021 10:27
-
-
Save chaitanya-lakkundi/5bab51a6a2baa2d2b9112cfdf572d9af to your computer and use it in GitHub Desktop.
Pratyahara Demo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Basic Pratyahara demo for students learning Python | |
msutra = ["अ", "इ", "उ", "ण्", "ऋ", "ऌ", "क्"] | |
# read pratyahara user input | |
pratyahara = input() | |
# entering अण् | |
startvarna = pratyahara[0] | |
endvarna = pratyahara[1:] | |
print(startvarna) | |
print(endvarna) | |
# search for startvarna in msutra | |
position = 0 | |
startpos = 0 | |
endpos = 0 | |
for every_varna in msutra: | |
if every_varna == startvarna: | |
print("found the start varna") | |
startpos = position | |
if every_varna == endvarna: | |
print("found the end varna") | |
endpos = position | |
position = position + 1 | |
print(startpos, endpos) | |
print(msutra[startpos:endpos]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment