Python Program - multiple objects

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 ก.ย. 2024
  • Design a class that store the information of Student (rollno, name and age) with a constructor to initialize the data member’s and display() method to display all the details.
    1) Accept n-number of students details
    2) Display the details of all the students in ascending order of name

ความคิดเห็น • 30

  • @rahulparmar208
    @rahulparmar208 5 ปีที่แล้ว +1

    Exactly what i have been searching for last one month

    • @MicroNG
      @MicroNG  5 ปีที่แล้ว +1

      Thank u for this lovely comment.

    • @rahulparmar208
      @rahulparmar208 5 ปีที่แล้ว

      @@MicroNG if i had seen this video a month earlier.. I wud not have got rejected in interview

    • @rahulparmar208
      @rahulparmar208 5 ปีที่แล้ว

      @@MicroNG sir please give videos on scraping, crawling also...

  • @ap9188
    @ap9188 5 ปีที่แล้ว +1

    Loved the way you taught.. 👍👍

    • @MicroNG
      @MicroNG  5 ปีที่แล้ว +1

      Thank u

  • @tanaynagarsheth4762
    @tanaynagarsheth4762 4 ปีที่แล้ว +1

    thankyou, this simple concept was hard to find, very well explained

    • @MicroNG
      @MicroNG  4 ปีที่แล้ว

      Thank u for the feedback

  • @Thiyagadhayalan
    @Thiyagadhayalan 5 ปีที่แล้ว +1

    good one

  • @DZAKY244
    @DZAKY244 6 ปีที่แล้ว +1

    Thank you , you code helped my last project

    • @MicroNG
      @MicroNG  6 ปีที่แล้ว

      welcome.

  • @manolo6048
    @manolo6048 3 ปีที่แล้ว

    This is a great video, but is it possible to achieve the same results without knowing "n"(the number of instances?)
    considering student class has been imported into another class, and we want multiple instances of Student objects with necessarily define how many we want.

  • @rhinoprincesafterburner
    @rhinoprincesafterburner 5 ปีที่แล้ว +1

    You saved my life ಥ_ಥ

  • @RISHIKESH_MORE
    @RISHIKESH_MORE 7 ปีที่แล้ว

    thank you sir and awesome video 🙏🙏🙌

  • @farukacar9970
    @farukacar9970 4 ปีที่แล้ว +1

    thank you, it helped me alot

    • @MicroNG
      @MicroNG  3 ปีที่แล้ว

      Thank u Faruk for your feedback

  • @anubhavsharma9449
    @anubhavsharma9449 4 ปีที่แล้ว +1

    we makes object as obj=classname(arg) but in this we do not do same why?

    • @MicroNG
      @MicroNG  4 ปีที่แล้ว

      we are making the object same way classname(arg).
      Only here we are not mentioning the object name. because we have n, number of objects that will get created dynamically and get inserted into list.
      So each element of the list will be an object of the Student class

    • @abhinavmehta1010
      @abhinavmehta1010 4 ปีที่แล้ว

      @@MicroNG See in this case we are creating a 'nameless object' of the class and storing it in the list so we can operate those objects by list reference.

  • @omarfarag3257
    @omarfarag3257 6 ปีที่แล้ว

    Thanks this was helpful. Would love to know how to pass this list information down to other classes (sub classes, related classes etc.)

    • @MicroNG
      @MicroNG  3 ปีที่แล้ว

      nice to hear from u Omkar

  • @TienFlower
    @TienFlower 5 ปีที่แล้ว

    Some of the codes did not work such as the append command, and display command

    • @MicroNG
      @MicroNG  5 ปีที่แล้ว

      may i know exactly what error is coming

    • @TienFlower
      @TienFlower 5 ปีที่แล้ว

      @@MicroNG append doesn't take any parameter, and display require argument position "Self"

  • @sunnymaurya4633
    @sunnymaurya4633 7 ปีที่แล้ว

    Sir can you make video on this program
    write a class named as employee for reading and writing the employee information using function getinfo() and displayinfo and also make use of constructor

    • @MicroNG
      @MicroNG  3 ปีที่แล้ว

      Okie

  • @abmisal
    @abmisal 7 ปีที่แล้ว

    Thank you sir

  • @zaighamawan1215
    @zaighamawan1215 2 ปีที่แล้ว

    u r not creating multiple objects u r just assigning multiple attributes to single object and saving it each time in a list
    i rather make a dictionary with three items and save it in a list whats the purpose of class then if we cant create seperate objects

    • @MicroNG
      @MicroNG  2 ปีที่แล้ว

      Each list element is an object of the class defined
      If you don't want to store object in a list, it can be created with different names as well

    • @zaighamawan1215
      @zaighamawan1215 2 ปีที่แล้ว

      @@MicroNG yes thats what m intrested in how to creat seperate object that i can acces outside the loop