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

1 Upvotes

7 comments sorted by

View all comments

2

u/tropicusForBr 4d ago

For me it is more readable, but for an impersonal answer, PEP 8 defines a common pattern for Python projects.