Sunday, December 27, 2020

python day 19 classes

 # -*- coding: utf-8 -*-

"""

Created on Mon Dec 28 07:41:21 2020

day 19

topic : class


@author: anil durgam


class praveen():

    pass


praveen()



class praveen():

    print("praveen rocks!!!")


p=praveen()

print(p)


class praveen():

    print("praveen rocks!!!")

    print("praveen rocks!!!")

    print("praveen rocks!!!")

    print("praveen rocks!!!")

    print("praveen rocks!!!")

    print("praveen rocks!!!")

    print("praveen rocks!!!")

    


p=praveen()

print(p)


class praveen():

    x=10

    print(x)

    


p=praveen()

print(p)


class praveen():

    x=10

    #print(x)

    


p=praveen()

#print("printx ",p.x)

a=p.x

print("a",id(a))


z=praveen()

b=z.x

print("b=:",id(b))


class praveen():

    x=10

    #print(x)

    


p=praveen()

print("printx ",p.x)

p.x=20

print("printx ",p.x)


class praveen():

    x=10

    #print(x)

    


p=praveen()

print("printx ",p.x)

p.x=20

print("printx ",p.x)


p.x=500

print("printx ",p.x)


class student():

    name="rakesh"

    lastname="daggubati"

    a=10

    b=20

    c=30

    

p=student()

print(p.name)

print(p.lastname)

print(p.a)

print(p.b)

print(p.c)


class student():

    name="rakesh"

    lastname="daggubati"

    a=10

    b=20

    c=30

    

p=student()

print(id(p))

print(id(p.name))

print(id(p.lastname))

print(id(p.a))

print(id(p.b))

print(id(p.c))


class student():

    name="rakesh"

    lastname="daggubati"

    a=10

    b=20

    c=30

    

p=student()

print(type(p.name))

print(type(p.a))


class student():

    name="rakesh"

    lastname="daggubati"

    a=10

    b=20

    c=30

    

student()

print(student.a)

"""

class student():

    def __init__(self):

        name="rakesh"

        print(name)

    

    

student()

print(student)


    





No comments:

Post a Comment

python class topic video