I'm new to python, and I just want to know a way of changing a set string variable.
For example:
name ='school'
How would I go about changing this if I wanted to use the name variable for a different value like George, Ben, Jess, Katie, etc.
You can assign a new value to a variable in the same way you originally assigned a value to it: Using the assignment operator, =.
name = 'school'
print 'the current value of name is:', name
name = 'George'
print 'the current value of name is:', name
Result:
the current value of name is: school
the current value of name is: George
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With