How to check python installed or not on fedora 37?

How to check python installed or not on fedora 37 | RHEL 8/ Centos8

in fedora 37, lets see how to check python installed or not.

[root@fedora ~]# python -V

Output:

Python 3.11.2

Lets run sample python program using python cli environment,

[root@fedora ~]# python

Python cli environment,:

Python 3.11.2 (main, Feb  8 2023, 00:00:00) [GCC 12.2.1 20221121 (Red Hat 12.2.1-4)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> print('Hello World'_
  File "", line 1
    print('Hello World'_
          ^^^^^^^^^^^^^^
SyntaxError: invalid syntax. Perhaps you forgot a comma?
>>> print('Hello World')
Hello World
>>> exit
Use exit() or Ctrl-D (i.e. EOF) to exit
>>> exit()

Creating python program,

[root@fedora ~]# cat test.py
#first program

print('Hello World')

Output:

[root@fedora ~]# python test.py
Hello World



Python installation

Privacy Policy  |  Copyrightcopyright symbol2020 - All Rights Reserved.  |  Contact us   |  Report website issues in Github   |  Facebook page   |  Google+ page

Email Facebook Google LinkedIn Twitter
^