0

Can we change variables after putting the if statement ?

Can I possibly change a variable after putting the if statement so it will print ? What I want to know its how can I make my if-statement works when I change my variable so im asking is there any functions or anything like this that can make my code to read again the if-statement Ex : https://code.sololearn.com/cP7RfqT9V9Vs/?ref=app

2nd Jan 2019, 3:44 PM
Maxence
2 Answers
+ 3
Generally your code is read line by line, so the if-condition must be True in the moment it is checked. But can you explain a bit more, what exactly you want to accomplish? It will be easier to find a solution.
2nd Jan 2019, 4:00 PM
HonFu
HonFu - avatar
+ 1
Maxence, The if-statement only checks content of the block of statement before that if-condition and not those after it. To achieve what you want from your code, you will have to include another if-statement (similar to line 3 & 4) after re-defining the variable 'Start' (i.e since you re-assigned the variable 'Start', you will need another if-condition).
2nd Jan 2019, 7:42 PM
Ojabuoma Miracle Iyanu
Ojabuoma Miracle Iyanu - avatar