-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexercise_19.py
31 lines (25 loc) · 867 Bytes
/
exercise_19.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
print(
'-----------------------------------------\n'\
'Practical python education || Exercise-19:\n'\
'-----------------------------------------\n'
)
print(
'Task:\n'\
'-----------------------------------------\n'\
'Write a Python program to get a new string from a given string where "Is" has been added to the front. If the given string already begins with "Is" then return the string unchanged."\n'
)
print(
'Solution:\n'\
'-----------------------------------------'\
)
def new_string(str):
if len(str) >= 2 and str[:2] == "Is":
return str
return "Is " + str
print(new_string(input("Enter your string: ")))
print(new_string(input("Enter your string again: ")))
print(
'\n-----------------------------------------\n'\
'Copyright 2018 Vladimir Pavlov. All Rights Reserved.\n'\
'-----------------------------------------'
)