aboutsummaryrefslogtreecommitdiff
path: root/challenge-278/eric-cheung/python/ch-2.py
blob: e173d974d8e123c3d856df311c970ef3dff9022a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
## Example 1
## strInput = "challenge"
## charInput = "e"

## Example 2
## strInput = "programming"
## charInput = "a"

## Example 3
strInput = "champion"
charInput = "b"

if charInput in strInput:
    nPos = strInput.find(charInput)
    print ("".join(sorted(strInput[:nPos + 1])) + strInput[nPos + 1:])
else:
    print (strInput)