I work on code which will give back all what user inserts. If user inserts secret_password then his next text after it should be formatted. Format of text should looks like:
john smith , JOHN SMITH , john , joh
john smithn + JOHN SMITH is easy and done below in the code.
Unfortunately, I don't know how to slice half part or other part of the string once the string can have other number of characters every time when user inserts something.
Could you please, suggest something. Code is done there is only missing slicing of the string.
print("Program echo v2!")
secret_password = "premium-code-2019"
text = ""
text_formatted = ""
while True:
user_text = input()
if user_text == secret_password:
text = input("Insert the text")
text_formatted = text +" "+text.upper()
print(tekxt_formatted)
elif user_text != secret_password:
print(user_text)
if user_text == "":
break