I want to change a variable from a function like this: def addone(x): #Some code inp = 5 addone(inp) print(inp) #Prints 6 I tried this: def addone(x): x += 1 The variable only changes inside the function though, and the value outside did not change. Continue reading...