Barebones of python programming

Nikhil Pandey
2 min readMay 13, 2023

--

⏮️previous page ⏭️next page

After reading you will be able to:

⭐Understand expression, statements, comments, functions and block

⭐Create variable

⭐What is dynamic typing in python

⭐Multiple assignment

Expression: which is any legal combination of symbols that represents a value?

Statement: which are programming instructions?

Comments: which is the additional readable information to clarify the source code can be either triple-quoted strings or multiple # style comments.

Functions: which are named code section and can be reused by specifying their names function calls.

Block or suits: which is a group of statement which is part of another statement or function? All statement inside a block or suite is indented at the same level.

Variables and assignment

Variable represent labeled storage locations, where values can be manipulated during program run.

student='jacob'
age='15'

Dynamic Typing

A variable is assigned by assigning it with some value of a particular type such as numeric, string etc.

x=10
print(x)

x='hello world'
print(x)

A variable pointing to a value of certain type can be made to point to a value/object of different type. This is called dynamic Typing.

Multiple assignments

Assuming same value to multiple variables. You can assign same value to multiple variable in a single statement e.g.,

a=b=c=10

It will assign value 10 to all three variables a,b,c.

you can also assign multiple variables multiple values, here are steps to work on:

a,b,c=1,2,3
print(a,b,c)

Multiple assignment can also be used when changing element of tuple. Tuple being an immutable data type can be made to change it’s variable at a place by multiple assignment.

That’ll for today! Bye (please mail me if your find anything to be improved. pandeynikhilone@gmail.com) or Have any suggestion! fill form

⏮️previous page ⏭️ ️️️next page

--

--

Nikhil Pandey

I am a student and a programming nerd. I learn and teach topics to help my fellow readers understand and apply their programming knowledge fluently.