Linux Tutorial
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
Linux Tutorial
Privacy Policy | Copyright2020 - All Rights Reserved. | Contact us | Report website issues in Github | Facebook page | Google+ page