You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'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'\