Skip to navigation Skip to main content

Python Fundamentals: A Beginner's Guide to Basic Python Coding

Learn the Core Concepts of Python Programming, Including Variables, Data Types, Operators, and More, to Kickstart Your Coding Journey.

Welcome back! I’m going to share with you some really basic Python code for beginners.

Disclaimer: The contributor(s) cannot be held responsible for any misuse of the data. Quick Link to Specific Topic:

Part 1- Variable declaration in Python.

a="dhaka"
b="dhaka"

print(a)

a=123

print(a)
print(b)

b=456
print(b)

c='dhaka'
d=c

print(c==d)
print(d is c)

Some Variable Declaration Rules:

  • Reserved word (keyword) can not be a variable
  • Start with letter or underscore
  • Don’t start with a number
  • Variable name can contain letters, number, underscore
  • Don’t include special characters in variable names

Part 2- Playing with Numbers.

int_num = 10
float_num = 20.0

print(int_num)
print(float_num)

a = 10
b = 20

print("*******************")

add = a + b
print(add)

sub = b - a
print(sub)

multi = a * b
print(multi)

div_mychoice = b / a
print(div_mychoice)

Part 3- Get to know python Boolean .

a = True
b = False

print(a)
print(b)

print("**************************")
print(bool(0))
print(bool(1))
print(bool(2))

c = ""
print(bool(c))

c = "Some Value"
print(bool(c))

Part 4- String in Python .

a = "This is a simple string"
b = 'Using single quotes'

print(a)
print(b)

c = "Need to use 'quotes' inside a string"
print(c)

d = "Another way to handle \"quotes\""
print(d)

a = "This is a single\
 string"
print(a)

As this is a introductory series we will not discuss everything about python. But here sharing some source code for better practices

Part 5- Source Code from Books:

Python The Hard Way

Python The Hard Way

Automate The Boring Staff with Python

Automate The Boring Staff with Python

Extras:

Selenium Python

Selenium Python

Selenium Python Crash Course

Selenium Python Crash Course

Selenium with Python

Share: X (Twitter) Facebook LinkedIn