❌

Normal view

There are new articles available, click to refresh the page.
Before yesterdayAvinash Mathi

Slicing in python programming

14 September 2024 at 15:53

slicing prpgramming
a="Avinash"
print(a[:])
b="keeramangalam"
print(b[3:])
c="Hello Avinash"
print(c[4:])
d="Hello world"
print(c[:4])
e="Keeramangalam"
print(e[:-2])
g="Keeramangalam"
print(g[-5:-2])
o/p
Avinash
ramangalam
o Avinash
Hell
Keeramangal
gal

Strings in python programming

4 September 2024 at 16:24

string in programming
a="Hello"
b="Avinash"
print(a,b)
a="My name is Avinash"
print(a)
a="""My name is Avinash.I am come to keeramangalam,str(age(19)"""
print(a)
a="Avinash"
print(a[4])
a="Avinash"
print(len(a))
txt="The best beauitiful in india"
print("India" in txt)

modify string

a="Hello world"
print(a.upper())

lower case

a="Hello world"
print(a.lower())

replace string

a="Helllo world"
print(a.replace("h","r"))

strip string

a="Hello world"
print(a.strip())

string concentrated

a="Hello"
b="Avinash"
c=(a+b)
print(c)

add two values

a="Hello"
b="world"
print(a+""+b)
age=10
txt=f"My name is Avinash,Iam{age}"
print(txt)

o/p
Hello Avinash
My name is Avinash
My name is Avinash.I am come to keeramangalam,str(age(19)
a
7
False
HELLO WORLD
hello world
Helllo world
Hello world
HelloAvinash
Helloworld
My name is Avinash,Iam10

Data type in python

3 September 2024 at 15:22

Build in datatype
text type:string
Numeric type:int, float,complex
sequence type:List,Tuple,range
mapping type:Dictionary
set type:set,frozenset
Boolean type:bool
binary type:bytes,bytearray,memory view
none type:none type
program
a="Avinash"
print(type(a))
b=45
print(type(b))
c=5.0
print(type(c))
d=5+8
print(type(d))
e=["pencil","box","scale"]
print(type(e))
f=("Apple","orange","banana")
print(type(f))
for i in range(5,9):
print(i)
g=True
print(type(g))
h=False
print(type(h))
i={}
print(type(i))
j={5,7,8,99}
print(type(j))
o/p






5
6
7
8



based in python variable

3 September 2024 at 14:49

variable is collection of stored data

Variable

a=20
b="Avinash"
print(a,b)

casting

a=input()
b=input()
c=input()
print(a,b,c)

variablename

my_variablename="Python programming"
print(my_variablename)

variable a assign multiple value

x,y,z="Avinash","arjun","Arun"
print(x,y,z)

one value to multiple value

x=y=z="Avinash"
print(x,y,z)

unpack

movie=["Rayyan","singam","goat"]
x,y,z=movie
print(x,y,z)

gloabal variable

x="Avinash"
def myfun():
print("Python develop "+x)
myfun()

o/p
20 Avinash
4
5
6
4 5 6
Python programming
Avinash arjun Arun
Avinash Avinash Avinash
Rayyan singam goat
Python develop Avinash

Datatype in python

3 September 2024 at 01:38

Build in datatype
text type:string
Numeric type:int, float,complex
sequence type:List,Tuple,range
mapping type:Dictionary
set type:set,frozenset
Boolean type:bool
binary type:bytes,bytearray,memory view
none type:none type
program
a="Avinash"
print(type(a))
b=45
print(type(b))
c=5.0
print(type(c))
d=5+8
print(type(d))
e=["pencil","box","scale"]
print(type(e))
f=("Apple","orange","banana")
print(type(f))
for i in range(5,9):
print(i)
g=True
print(type(g))
h=False
print(type(h))
i={}
print(type(i))
j={5,7,8,99}
print(type(j))

o/p






5
6
7
8



Basic of python

29 August 2024 at 15:53

python
Basic of python
The python is the develop in the author: Guido van rossum in 1991
The python is interperters and compiler language
The python difference in interperters and compiler
interper:
It excutes a program line by line
It is a slow process
It does not generate any form of output
It takes less utilized of cpu
compiler:
It translates a program on a single run
It is fast process
It generate output in the form of .excuted
It is utilized cpu more

python program Lists

28 August 2024 at 01:38

mylist create

mylist=["singam","goat","rayyan","leo"]
print(mylist)
print(mylist[2])
mylist[1]="mersal"
print(mylist)
mylist=["singam","goat","raayan"]
mylist.append("mersal")
print(mylist)
mylist=["singam","goat","raayan"]
mylist.insert(1,"Mersal")
print(mylist)
mylist=["singam","goat","rayaan","mersal"]
mylist.remove("singam")
print(mylist)
mylist=["singam","goat","rayaan","mersal"]
for x in mylist:
print(x)
mylist=["singam","goat","rayaan","mersal"]
mylist.sort()
print(mylist)
mylist=["singam","goat","rayaan","mersal"]
mylist.pop()
print(mylist)
o/p
['singam', 'goat', 'rayyan', 'leo']
rayyan
['singam', 'mersal', 'rayyan', 'leo']
['singam', 'goat', 'raayan', 'mersal']
['singam', 'Mersal', 'goat', 'raayan']
['goat', 'rayaan', 'mersal']
singam
goat
rayaan
mersal
['goat', 'mersal', 'rayaan', 'singam']
['singam', 'goat', 'rayaan']

Feedback: Provide feedback on whether the guess is too high, too low, or correct.

14 August 2024 at 15:38

Feedback: Provide feedback on whether the guess is too high, too low, or correct.
program

high number

guess_number=input("Enter the high number:")
print(guess_number)
o/p
Enter the high number:9
9

Low number

guess_number=input("Enter the low number:")
print(guess_number)
o/p
Enter the low number:6
6

python program language operators

11 August 2024 at 06:01

python divides the operators in the following groups
Types of operators
Arithmetic operators
Assignment operators
comparison operators
logical operators
bitwise operators
Membership operators

program

Arithmetic operators

The Arithmetic operators is numeric value is mathematical operators
1.Addition
2.Subtraction
3.Multlplication
4.Division
5.Modules
6.Floor division

Addition

a=3
b=2
print(a + b)
O/P
5

subtraction

a=6
b=5
print(a-b)
O/P
1

multplication

a=25
b=25
print(a*b)
O/P
500

division

a=12
b=3
print(a/b)
O/P
4

modules

a=5
b=2
print(a % b)
O/P
1

floor division

a=15
b=2
print(a//b)
O/P
7
2.Assignment operators
The assignment operators is a assign value to varables

Assign values=

a=4
print(a)
o/p
4

Assign values+=

x=2
x+=2
print(x)
o/p
4

Assign value-=

x=2
x-=2
print(x)
o/p
0

Assign value*=

x=6
x*=2
print(x)
o/p
12

Assign value/=

x=6
x/=3
print(x)
o/p
2.0

Assign value%=

x=9
x%=4
print(x)
o/p
1

Assign values //=

x=5
x//=2
print(x)
o/p
2

assign value&=

x=8
x&=3
print(x)
o/
0

assign values ^=

x=7
x^=8
print(x)
o/p
15

assign values!=

x=5
x!=3
print(x)
o/p
5

assign values >>=

x=9
x>>=4
print(x)
o/p
0

assign values <<=

x=9
x<<=4
pr9int(x)
o/p
144
3.Comparsion operators
The Comparsion operatror is compare two values

equal ==

x=3
y=6
print(x==y)
false

not equal!=

x=3
y=6
print(x!=y)
o/p
True

greater equal>=

x=3
y=6
print(x>=y)
o/p
true

less equal<=

x=3
y=6
print(x<=y)
o/p
false
4.logical oiperators
AND
OR
NOT

AND

X=5
print(x>3 and x<10)
o/p
true

OR

x-5
print(x>3 or x<4)
o/p
true

NOT

x=5
print(x>3 not x<10))
o/p
false

❌
❌