In Python, we can index the words easily. This simple tip can provide us too much flexibility when we want to specify some parts of words as variables. This specified variables can be usefull in projects that use dictionaries, sets etc. Imagine a confirmation project, that checks some parts of user data with the middle or some strict pozitions of data. If the results pair with each others we can think about the code completed what we want to do.
Input() (From user) => Store Data (In Database) => User Must be Validated => The Validation & Confirmation Code Runs => Input() (Some parts of data that stored in database, taken from user) => Code checks out the datas => Wrong & Correct
username = "Mustafa Serhat" password = "pythonaddict" creditcard = "1234-5678-9123-4567" x = input("Enter the 5,6,7th. char. of your username : ") y = input("Enter the 5th, 9th and last char. of your credit card : ") crdt = creditcard+creditcard+creditcard[-1] usr = username[4:7] if x == usr and y == crdt: print("Well done !") print("Your password is", password) else: print("Wrong !!!")