Python Forum

Full Version: [split] How to ask Smart Questions (thread title expansion)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi. I'm trying to use semicolon for execute two command on one line but this is the result. Can anyone explain why?
Output:
>>> a=4 >>> b=5 >>> a;b 5 >>>
I do not think python works that way. If you wish to show both, use a comma

Output:
>>> a=4 >>> b=5 >>> a,b (4, 5) >>> print(a,b) 4 5 >>>

This worked for python 3.12. Does not work for python 3.13
Output:
>>> a;b 4 5 >>>
(Nov-11-2024, 08:56 AM)menator01 Wrote: [ -> ]I do not think python works that way. If you wish to show both, use a comma

Output:
>>> a=4 >>> b=5 >>> a,b (4, 5) >>> print(a,b) 4 5 >>>

This worked for python 3.12. Does not work for python 3.13
Output:
>>> a;b 4 5 >>>

Sir im getting online lessons for python and tutor coding on 3.7.2. So should i delete 3.13 and get 3.12. And even if i did what do you think will im a get smilar problems again?
I've started coding in 3.13 since it is now a stable release. I haven't found any problems with it yet.
I see no reason for installing 3.12. If you want compatibility with the lessons, install 3.7 or 3.8.