Python Tutorial > Python IDLE > Python Introduction (Part 2): What is Python IDLE and Python Syntax?
Posted in

Python Introduction (Part 2): What is Python IDLE and Python Syntax?

Python Introduction (Part 2)
Python Introduction (Part 2)

Previous Tutorial: Python Introduction (Part 1)

Python Introduction

Python Syntax

CODE:
print('Hello World!')
print('I am learning Python programming')
OUTPUT:
Hello World!
I am learning Python programming
CODE:
print(Hello World!)
OUTPUT:
SyntaxError: invalid syntax. Perhaps you forgot a comma?
CODE:
print(40478)
OUTPUT:
40478
CODE:
print(40478
OUTPUT:
SyntaxError: '(' was never closed
CODE:
text1 = 'Python'
text2 = 'Programming'
print(text1)
print(text2)
OUTPUT:
Python
Programming
CODE:
text1 = 'Python'
text2 = 'Programming'
print(text1)
print(Text2)
OUTPUT:
Python
NameError: name 'Text2' is not defined.

Work With Python in CMD Or PowerShell

CODE:
Python --version
OUTPUT:
Python 3.13.4
CODE:
print('Hello World!')
OUTPUT:
Hello World!
CODE:
>>>print('Hello')
>>> 4 + 4
>>>print('Python' * 3)
OUTPUT:
>>> print('Hello')
Hello
>>> 4 + 4
8
>>> print('Python' * 3)
PythonPythonPython
>>>
CODE:
print(Hello)
OUTPUT:
NameError: name 'Hello' is not defined

Work With Python in IDLE

Python IDLE
Basic Code in Python IDLE

Writing Python Code in Notepad

Writing Python Code in Notepad
Save Notepad Python Code FIle

Conclusion

Next Tutorial: Python Introduction (Part 3)

Summary
Python Introduction (Part 2): What is Python IDLE and Python Syntax?
Article Name
Python Introduction (Part 2): What is Python IDLE and Python Syntax?
Description
In this tutorial, we will learn about what syntax is in Python. How to write Python code in CMD and IDLE?
Author
Publisher Name
anotherdaywithpython.in
Publisher Logo

3 thoughts on “Python Introduction (Part 2): What is Python IDLE and Python Syntax?

Leave a Reply

Your email address will not be published. Required fields are marked *