Tuesday, June 14, 2022
Wednesday, June 8, 2022
class and objects
class and object example:
class Person:
def __init__(self,name,age,city):
self.name = name
self.age = age
self.city = city
p1 = Person ("shraddha",19,"babra")
print (p1.name)
print(p1.age)
print(p1.city)
Tuesday, June 7, 2022
array
what is an array?
array is special variable ,which can hold more than one value at a time.
example:
car1 = " ford "
car2 = "bmw"
car3 ="volvo"
EXAMPLE:
modify the value of the first array item:
cars[0] = "toyota"
Subscribe to:
Posts (Atom)