Skip to content

Introduction To Python

surendrabisht edited this page Jul 10, 2020 · 2 revisions

Python is an interpreted language. Interpreted language means every code will be compiled and executed at the same time line by line. If there is any syntax error on line 20 , till line 20 program will run as expected and then it will throw an error.

Lets write our first program to show "Hello world " on console screen.

print(" Hello World")

that's it. here print() is a function to print the message enclosed in double quotes to console screen.

Now, lets look at how data will be shown with the message.

dayOfLecture = 1
print(f" this is day {dayOfLecture } of Python class")

Data Types in Python:

Python Data Types

Comments and Coding Style

Sometimes, if the logic is tricky and you want to inform others about your logic or have doubt that you will remember a big part of logic , you can write comments above the code.
Comments are written with prefix #.
For Example:
# This is a comment telling you that this code will print Welcome! 3 times.
print("Welcome! "*3)

Clone this wiki locally