Python Basic Syntax
Contents
Python is used in automation of taskes.
Note
Use the table of contents to navigate to the portion that you are interested in.
Introduction
Python is a beginner-friendly, interpreted programming language known for its readability and versatility. With a vast standard library and cross-platform compatibility, it’s widely used in web development, data science, and automation.
Print function
|
|
output
it's meeeeeeeeeeee
o----
||||
**********
Datatype
|
|
Input function
|
|
String and character
#formatted string
|
|
output
sumit [kr] is a programmer.
Length of a string
|
|
Converting lower case to uppercase
|
|
Returning the index of a character in a string
|
|
Replacing a word in a string
|
|
Checking if the string contain a word or not
|
|
Arithmatic operations
|
|
Augmanted assignment operator
|
|
Presidence order
- parenthesis
- exponentiation 2**3
- multiplication or division
- addition or subtraction
|
|
Math function
|
|
If and else if statement
|
|
output
It,s a hot day
drink plenty of water
Task
|
|
output
100000
Logical opoerators
Task
|
|
output
Eligible for loan
Comparision operator
, < , >= , <= , == , !=
Task
|
|
output
it's a hot day
Task
|
|
While loops
|
|
output
*
**
***
****
*****
Done
Task: Guess number
|
|
Task: Car game
|
|
For loop
|
|
Task
|
|
Nested loop
adding one loop in the another loop
|
|
Task
|
|
output
xxxxx
xx
xxxxx
xx
xx
xxxxx
xx
xxxxx
xx
xx
Lists
|
|
Task: Largest no
find the largest number in the list
|
|
2D lists
|
|
List methods
|
|
Task: Remove duplicates
write a program to remove the duplicates in a list.
|
|
Tuples
similar to list. we dont have append or insert method here. we also dont have remove, clear, pop. we have count, index
|
|
Unpacking
|
|
Dictionaries
|
|
Task: Digits to word
translate digits to words
|
|
output
>Phone: 123456
One Two Three Four Five Six
Emoji Converter :)
|
|
To be continued…..