After the installation of Python, we can do some basic coding in CMD. Open CMD or PowerShell. If we want to check the Python version. Simply type the below code in CMD and press Enter.
CODE:
Python --version
OUTPUT:
Python 3.13.4
In the output, we get the information about Python version that is installed in your system. We can do some basic coding in CMD. For example, first type “Python” and then press enter. Then we can use the print() function, type the below code and press enter.
CODE:
print('Hello World!')
OUTPUT:
Hello World!
We can do some other coding like:
CODE:
>>>print('Hello')
>>> 4 + 4
>>>print('Python' * 3)
OUTPUT:
>>> print('Hello')
Hello
>>> 4 + 4
8
>>> print('Python' * 3)
PythonPythonPython
>>>
Python syntax is the same here if we write like this:
CODE:
print(Hello)
OUTPUT:
NameError: name 'Hello' is not defined
We didn’t surround text with quotes, so we get an error. We can write code in CMD, but IDEs provide more features and a more convenient way to write code.