Skip to main content

Python Syntax

What is syntax?


  • Syntax is the arrangement of words in a specific order to create sentences in Python Programming.
  • If you change the position of even one word then the code will give you an error

  • Python Syntax is like English grammar

Example:
   

 Input:

print("Hello World")
a="This is my first code"
print(a)
Output:
Hello World
This is my first code


 





Comments

Popular posts from this blog

Python Variables

What are variables?   In Python, variables are names, references or identifiers that store the values. A variable is a  name  associated with a  memory location  where data is stored. They can hold different types of data such as numbers, strings, lists, etc. Input x=5 y="John" Here x, and y are variables which store Data (5 and "Jo hn") The rule for naming variables? Choose a descriptive name for your variable that accurately reflects the purpose or value it holds. A variable name must start with a letter or the underscore character(A-z or _) A variable name cannot start with a number A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ ) Variable names are case-sensitive (age, Age and AGE are three different variables) A variable name cannot be any of the  Python keywords . Previous (Python Comments) Next()

Python Index

                                                               Python Index Mastering Python: A Comprehensive Guide Python Syntax Python Indentation Python Comments Python Variables