Categories
By Aman Kharwal

Python Full Course

Python full course from beginner to advance

Getting Started with Python

Python is a widely used high-level programming language for general-purpose programming, created by Guido van Rossum and first released in 1991. Python features a dynamic type system and automatic memory management and supports multiple programming paradigms, including object-oriented programming, imperative, functional, and procedural styles. It has a large and comprehensive standard library.

You can download and install python from here.

Hello, World in Python using IDLE

IDLE is a simple editor for python that comes bundled with python.

Open IDLE on your system, it will open a shell with options along at the top.

  • In the shell, there is a prompt of three right angle brackets:
  • Now write the following code in the prompt:

print(“Hello, World”)

  • Hit Enter

Creating variables and assigning values

<variable name> = <value>

Python uses = to assign value to variables, There is no need to declare a variable in advance, or to assign a data type of it. Assigning a value to a variable itself declares and initializes the variable with that value. There is no way to declare a variable without assigning it an initial value.

# Integer
a = 2
print(a)
# Output: 2

# Floating Point
pi = 3.14
print(pi)
# Output: 3.14

# String
name = "Aman Kharwal"
print(name)
# Output: Aman Kharwal
# Boolean
a = True
print(a)
# Output: True

Variable assignment works from left to right. So, the following code will give you error.

0 = x
print(x)
SyntaxError: can't assign to literal

Datatypes

Numbers:

Int: Integer
a = 2
b = 25
c = 100

Float: Floating Point
a = 2.0
b = 500.e0
c = 1245687979.e1 
Complex:
a = 2 + 10j
b = 100 + 100j 
Strings
a = "Aman"
b = "Kharwal"
c = "Aman Kharwal"
Sequences and Collections:
Tuple: An ordered collection of n values of any type (n >= 0).
a = (1, 2, 3)
b = ('a', 1, (1,2))


List: An ordered collection of n values (n >=0)
a = [1, 2, 3]
b = ['a', 1, [1, 2, 3], [3, 2, 'd']]

Set: An unordered collection of unique values. Items must be hashable.
a = {1, 2, 'a'}


Dict: An unordered collection of unique key-value pairs, keys must be hashable.
a = {1 : 'one', 2 : 'two'}
b = {'a' : 'apple', 'b' : 'book'}

Next Chapter

39 replies on “Python Full Course”

I am happy to study this course. it is valuable. I didn’t have experience in python,but now,I am able to deal with it.
Thanks Aman kharwal

It’s to much good and a complete python learning site .. its really attractive and cool one ❤️❤️✌️✌️ keep growing like this ..

Am soo pleased to learn tern wid this site
Its soo helpfull and very easy way to learn language.
Tnkx for this amazing way of knowledge 👍🏻

Leave a Reply