Subscribe this Blog

Wikipedia

Search results

Notifications and New Posts!

Tuesday, November 10, 2020

YouTube Premiered Lecture - November 11, 2020, 11:00 AM - ADVANCED PROGRAMMING CONCEPTS - Python (TY A and B)

 ADVANCED PROGRAMMING CONCEPTS - Python

Due to internet/network connectivity issue, 

I will be conducting lecture on YouTube. 
Lecture will start at sharp 11:00 AM today. 
Please attend it. And if you have any questions then
please ask in Comment box below the video.

In this Session, I have covered following points: Python

Due to Internet connectivity issue making premiered video can be great tool 
where without any kind of interruption students can watch lecture video.

YouTube Session
ADVANCED PROGRAMMING CONCEPTS - Python (TY A and B)
Punyashlok Ahilyadevi Holkar Solapur University.
TY Mechanical Engineering Students.
Ref.: https://www.w3schools.com/python/
For more clarity please watch YouTube video with 360p or 480p Quality. 
Please click on the three vertical dots on video then select Quality option.
Then select resolution as 360p or 480p.

Please write you Name and Roll Number in Live Chat Box/Comment Box (below Video in YouTube) to capture your attendance.
YouTube Video Lecture: 
This video is premiered it will start at sharp 11:00 AM today.
To ask questions in Chat Box/Comment Box :


Facebook Event Registration: Click here

Python Programs:
#Add a year parameter, and pass the correct year when creating objects.

class Person:
  def __init__(self, fname, lname):
    self.firstname = fname
    self.lastname = lname

  def printname(self):
    print(self.firstname, self.lastname)

class Student(Person):
  def __init__(self, fname, lname, year,byear):
    super().__init__(fname, lname)
    #self.graduationyear = year
    self.yd=year
    self.birthyear=byear

x = Student("Rahul", "Shinde", 2019,2000)
print("First Name:",x.firstname)
print("Last Name:",x.lastname)
#print("Graduation Year:",x.graduationyear)
print("YD Year:",x.yd)
print("Birth Year:",x.birthyear)
Output:
First Name: Rahul
Last Name: Shinde
YD Year: 2019
Birth Year: 2000
-------------------------------------
#Adding new properties for the child or derived class.
class Person:
  def __init__(self, fname, lname):
    self.firstname = fname
    self.lastname = lname

  def printname(self):
    print(self.firstname, self.lastname)

class Student(Person):
  def __init__(self, fname, lname):
    super().__init__(fname, lname)
    self.graduationyear = 2019
    self.bg="AB+"

x = Student("Ram", "Shinde")
print("First Name:",x.firstname)
print("Last Name:",x.lastname)
print("Graduation Year is:",x.graduationyear)
print("Blood Group:",x.bg)
Output:
First Name: Ram
Last Name: Shinde
Graduation Year is: 2019
Blood Group: AB+
--------------------------
# Use the super() Function
# Python also has a super() function
# that will make the child class inherit
#     all the methods and properties from its parent.

class Person:
  def __init__(self, fname, lname):
    self.firstname = fname
    self.lastname = lname

  def printname(self):
    print(self.firstname, self.lastname)

class Student(Person):
  def __init__(self, fname, lname):
    super().__init__(fname, lname)

x = Student("Rahul", "Shinde")
x.printname()

# By using the super() function,
# you do not have to use the name of the parent element,
# it will automatically inherit the methods and properties from its parent.

Output:
Rahul Shinde
-------------------------------
class Person:
  def __init__(self, fname, lname):
    self.firstname = fname
    self.lastname = lname

  def printname(self):
    print(self.firstname, self.lastname)

class Student(Person):
  def __init__(self, fname, lname):
    Person.__init__(self, fname, lname)

x = Student("Rahul", "Shinde")
x.printname()

Output:
Rahul Shinde
----------------------------
# Create a Child Class
# To create a class that inherits the functionality from another class,
# send the parent class as a parameter when creating the child class.

class Person:
  def __init__(self, fname, lname):
    self.firstname = fname
    self.lastname = lname

  def printname(self):
    print(self.firstname, self.lastname)

#Use the Person class to create an object, and then execute the printname method:

fn=input("Please enter first name:")
ln=input("Please enter last name:")

x = Person(fn, ln)
x.printname()

class Student(Person):
  pass

y = Student("Rahul", "Shinde")

y.printname()

# Note: Use the pass keyword
# when you do not want to add any other properties or methods to the class.
Output:
Please enter first name:Ganesh
Please enter last name:Shinde
Ganesh Shinde
Rahul Shinde
---------------------------------------
# Python Inheritance
# Inheritance allows us to define a class
#     that inherits all the methods and properties from another class.
# Parent class is the class being inherited from, also called base class.
# Child class is the class that inherits from another class, also called derived class.

class Person:
  def __init__(self, fname, lname):
    self.firstname = fname
    self.lastname = lname

  def printname(self):
    print(self.firstname, self.lastname)

#Use the Person class to create an object, and then execute the printname method:

fn=input("Please enter first name:")
ln=input("Please enter last name:")

x = Person(fn, ln)
x.printname()
Output:
Please enter first name:Rahul
Please enter last name:Shinde
Rahul Shinde
---------------------------------
# The pass Statement
# class definitions cannot be empty,
# but if you for some reason have a class definition with no content,
# put in the pass statement to avoid getting an error.

class Person:
  pass

Output:

-------------------------------
# The self Parameter
# The self parameter is a reference to the current instance of the class,
#     and is used to access variables that belongs to the class.
#
# It does not have to be named self ,
# you can call it whatever you like,
# but it has to be the first parameter of any function in the class.

class Person:
  def __init__(myobject, name, age):
    myobject.name = name
    myobject.age = age

  def myfunc(abc):
    print("Hello my name is " + abc.name)
    print(abc.name," your age is",abc.age)

p1 = Person("Ram", 36)
p1.myfunc()


#Modify Object Properties
p1.name="Rahul"
p1.age = 40

print(p1.name,"is your changed name and",p1.age,"is your modified age!!")

#-------------------------
# Delete Object Properties
# You can delete properties on objects by using the del keyword:

# del p1.age
# print(p1.age)
#del p1.name

#----------------
# Delete Objects
# You can delete objects by using the del keyword:

del p1

Output:
Hello my name is Ram
Ram  your age is 36
Rahul is your changed name and 40 is your modified age!!

Present Students for Session:
SAMARTH CHAVAN ​TA15
TYB_44 Aftab Shaikh ​TYB_44
Namrata Parvat ​TYA_07
Dhanashree Sonawane ​TYB06
TYA_73 Ashley Thomas ​TYA_73
TYA_51 Samarth Mane-Deshmukh ​TYA_51
AMIT YELE ​TYB_76
TYB_41 Yasar Khatik ​TYB_41
Snehal Mane ​TYB_04
Vinayak Bapat ​TYB_11
Suraj More ​TYA45
TYA_13 Atish Jadhav ​TYA 13
TYA_64 Sohel Shikalgar ​TY A 64
Prajwal Musale ​TYA_55
TYB_53 Krishna Langote ​TYB_53
Yogesh patil ​TYB_36
TYB_20 Dhondiram Waghmode ​TB20
Saleha Mirjkar ​TYA-05
Yogesh Autade ​TYB_57
TYA_44 Mangesh Misal ​TYA_44
Pratik Deshmukh ​TYB _14
Harshvardhan Ubale ​TYB_50
Hritik Bhosale ​TYB 12
saurabh chavan ​TYA_16
ABHI KHOTE ​TYB_22
Jaydev nanaware ​TYB_31
TYB_33 Ridham Parmar ​TYB_33
Pratik Deshmukh ​TY
TYB_55 Saurabh Wadekar ​TYB 55
TYB_75 Hrushikesh Walujkar ​TYB_75
manthan dixit ​TYB16
TYB_58 SANDIP BAGUL ​TYB_58
Pratik Deshmukh ​TYB_14
TYB_71_Onkar Kale ​TYB_71
Harshal Nagtilak ​TYB_30
OMKAR PAWAR ​TYB37
TYB_34 Madan Patil ​TYB_34
TYB_70 Akash Mane ​TYB_70
TYB_03 Arati Lale ​TYB 30
ADESH BANKAR ​TYB_09
Sushant Jadhav ​TYB_65
TYB_73 vaibhav Jagtap ​TYB73
Shubham Deokar ​TYB72
Prathmesh Kirgat ​TYA_41
Om Metkari ​TYB_28
TYB_03 Arati Lale ​TYB 03
PrerAna Ekatpure ​TYB02
Pranay Disale ​TYA_50
TYB_17 Abhinay Gaikwad ​TB17
Omkar Jagtap ​TYB_66
Vaibhav Bhosale ​TB 13
Nikhil Mundhe ​TYA47
Kashiling Sarak ​TYB_42
Amol Sul ​TA11
Komal Achugatla ​TYA_01
Sachin Waghmare ​TA49
Dnyaneshwar Bansode ​TYA_12
TYB_41 Yasar Khatik ​TB 41
Yash Gadekar ​TYA_25
deepjyoti sathe ​TA08
Deepak Shinde ​TYB_46
Shashikant Thorat ​TA_66
Learning is essential. Learn Free ​TYB54
TYA_40 Rohit Khandagale ​TYA 40
Nanasaheb Shinde ​TYB_47
Akshay Pansare ​TA43
TYB_17 Abhinay Gaikwad ​TB17
Vaishnavi Lakheri ​TYA_04
Irfan Mulani ​TYA_54
TYB_77 Sumit Patwari ​TYB_77
Nilesh Kadam ​TB-21
Shraddha gajakosh ​TYA_02
Gayatri Joshi ​TYA_03
Sachin Kshirsagar ​TYA_42
Samruddhi Deshpande ​TYB_01
aniket bansode ​TYB_10
Pravin Somdale ​TYA_65
TYB_17 Abhinay Gaikwad ​TB17
Its_Pranav_ Show ​TYB 59
TYB_41 Yasar Khatik ​TB 41
Yogesh Autade ​TYB57
Madhuri Parchandrao ​TYA_06
Yogesh Autade ​TYB57
SAMARTH CHAVAN ​TA15
TYA_35 Parchandrao Chandragupta Vinayak ​TYA_35
Santosh Patil ​TYB_35
TYB_41 Yasar Khatik ​TYB_41
Rutik Godse ​TYA_31
Aazam Shaikh ​TYA_63


No comments:

Post a Comment