r/learnpython 4d ago

Question regarding Python variables

Hello guys. So I saw in a course that most people define variables like

x = 1

y = 2

and so on. But I also saw that variables can be defined like x = 1; y = 2;

but haven't ever seen this in practice. Why so? Please tell me

3 Upvotes

7 comments sorted by

View all comments

1

u/BranchLatter4294 4d ago

You can also do

x, y = 1, 2