I’m trying to make a setting section in my code where the user can change the setting which is already preset. But I’m not sure how i can make the input overwrite the already preset variable.
This is what I tried, but it doesn’t work, I’m not sure how to overwrite the variable and then keep it constant so it wont change unless the program has ended.
centreLine = 109
while True:
print("| [1] Centre line on screen")
print("| [2] Change username")
print("| [3] Change password")
print("| [BACK]")
print("| > ")
settingsInput = input("")
if settingsInput == "1":
print("| Change centre line to: ")
inputCentreLine = input()
inputCentreLine == (centreLine)
# I have no clue ^^^^^^^^^^^^
I want to overwrite ‘centreLine’ from 109 to whatever the user changes it too, eg/: 42, which would change ‘centreLine = 109’ to ‘centreLine = 42’.
Tao Connors is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.