+ 1

Variable phrasing

How would I get this to work so that the user could input b and data would swap to 40 in the equation and complete? Sorry if this is a dumb or simple question! Thanks in advance. a = 20 b = 40 data = input() print(20 * 10 + data)

2nd Dec 2021, 10:28 PM
McQuade Walters
McQuade Walters - avatar
1 Answer
+ 1
You could simply reassign data to b: b = int(data) Or replace data with b in the print
3rd Dec 2021, 10:56 AM
Lisa
Lisa - avatar