- 1

Variables On Python: Why?

Okay. . . Okay, why do we use 'del' why don't we just delete? For example: ' Lemons = 90 Apples = 4 del bar Apples = 8 print(Lemons * Apples) 360 ' Why not just delete the first Apple variable?

18th Aug 2020, 11:42 PM
Anna Moss
Anna Moss - avatar
1 Answer
+ 1
If this is from course content it's giving you the example of values can be changed. Also if you were making this code, you would just have one apple variable defined to be more pythonic.
19th Aug 2020, 12:17 AM
George Ryan
George Ryan - avatar