python1
python1
Programming
Code
Syntax
Similar to Grammar rules in English, Hindi, each programming language has a unique set of rules.
These rules are called the Syntax of a Programming Language.
Why Python
Python is an easy to learn, powerful programming language. With Python, it is possible to create
programs with minimal amount of code. Look at the code in Java and Python used for printing the
message "Hello World"
Java:
JAVA
1 class Main {
2 public static void main(String[] args) {
3 System.out.println("Hello World");
4 }
5 }
Python:
PYTHON
1 print("Hello World")
https://learning.ccbp.in/course?c_id=a6454e48-d030-4d49-8920-253198052232&t_id=6bdf14a9-2664-4a96-9764-89d965de71a0&s_id=0f715c8b… 1/6
7/27/24, 8:51 PM Revolutionizing the Job Market | NxtWave
1 print( Hello World )
Applications of Python
Big Data
Cyber Security
Game Development
Career Opportunities
DevOps Engineer
Software Developer
Data Analyst
Data Scientist
AI Scientist, etc.
Here is a simple Python code that you can use to display the message "Hello World"
Code
https://learning.ccbp.in/course?c_id=a6454e48-d030-4d49-8920-253198052232&t_id=6bdf14a9-2664-4a96-9764-89d965de71a0&s_id=0f715c8b… 2/6
7/27/24, 8:51 PM Revolutionizing the Job Market | NxtWave
PYTHON
1 print("Hello World!")
Output
Hello World!
Possible Mistakes
Possible mistakes you may make while writing Python code to display the message "Hello World"
1 prnt("Hello World!")
1 Print("Hello World!")
Missing quotes
PYTHON
1 print(Hello World!)
Missing parentheses
PYTHON
1 print("Hello World!"
https://learning.ccbp.in/course?c_id=a6454e48-d030-4d49-8920-253198052232&t_id=6bdf14a9-2664-4a96-9764-89d965de71a0&s_id=0f715c8b… 3/6
7/27/24, 8:51 PM Revolutionizing the Job Market | NxtWave
Code
PYTHON
1 print(2 + 5)
Output
If we want to print the exact message "2 + 5", then we add the quotes.
Code
PYTHON
1 print("2 + 5")
Output
2 + 5
Addition
Addition is denoted by
https://learning.ccbp.in/course?c_id=a6454e48-d030-4d49-8920-253198052232&t_id=6bdf14a9-2664-4a96-9764-89d965de71a0&s_id=0f715c8b… 4/6
7/27/24, 8:51 PM Revolutionizing the Job Market | NxtWave
Code
PYTHON
1 print(2 + 5)
2 print(1 + 1.5)
Output
7
2.5
Subtraction
Subtraction is denoted by
Code
PYTHON
1 print(5 - 2)
Output
Multiplication
Multiplication is denoted by
* sign.
Code
https://learning.ccbp.in/course?c_id=a6454e48-d030-4d49-8920-253198052232&t_id=6bdf14a9-2664-4a96-9764-89d965de71a0&s_id=0f715c8b… 5/6
7/27/24, 8:51 PM Revolutionizing the Job Market | NxtWave
PYTHON
1 print(2 * 5)
2 print(5 * 0.5)
Output
10
2.5
Division
Division is denoted by
/ sign.
Code
PYTHON
1 print(5 / 2)
2 print(4/2)
Output
2.5
2.0
https://learning.ccbp.in/course?c_id=a6454e48-d030-4d49-8920-253198052232&t_id=6bdf14a9-2664-4a96-9764-89d965de71a0&s_id=0f715c8b… 6/6