/ Python And R Data science skills: 10 Abstraction Encapsulation in telugu

Saturday 17 February 2018

10 Abstraction Encapsulation in telugu

10 Abstraction Encapsulation in telugu
In [1]:
li=[1,3,4,6]
In [2]:
li
Out[2]:
[1, 3, 4, 6]
In [3]:
type(li)
Out[3]:
list
In [4]:
li.append(44)
In [5]:
li
Out[5]:
[1, 3, 4, 6, 44]
In [1]:
#your choice
class Library:
    def __init__(self,listofbooks):
        self.availablebooks=listofbooks
    def displayAvailablebooks(self):
        print("The books we have in our library are as follows:")
        print("================================")
        for book in self.availablebooks:
            print(book)  

    def lendBook(self,requestedBook):
        if requestedBook in self.availablebooks:
            print("The book you requested has now been borrowed")
            self.availablebooks.remove(requestedBook)
        else:
            print("Sorry the book you have requested is currently not in the library")
                  
        
    def addBook(self,returnedBook):
        self.availablebooks.append(returnedBook)
        print("Thanks for returning your borrowed book")            
        
class Student:
    def requestBook(self):
        print("Enter the name of the book you'd like to borrow>>")
        self.book=input()
        return self.book

    def returnBook(self):
        print("Enter the name of the book you'd like to return>>")
        self.book=input()
        return self.book

    
library=Library(["php","seo","python"])
student=Student()

print(""" ======LIBRARY MENU=======
              1. Display all available books
              2. Request a book
              3. Return a book
              4. Exit
              """)

choice=int(input("Enter Choice:"))
if choice==1:
    library.displayAvailablebooks()
elif choice==2:
    library.lendBook(student.requestBook())
elif choice==3:
    library.addBook(student.returnBook())
elif choice==4:
    quit()
 ======LIBRARY MENU=======
              1. Display all available books
              2. Request a book
              3. Return a book
              4. Exit
              
Enter Choice:4
In [1]:
#your choice
class Library:
    def __init__(self,listofbooks):
        self.availablebooks=listofbooks
    def displayAvailablebooks(self):
        print("The books we have in our library are as follows:")
        print("================================")
        for book in self.availablebooks:
            print(book)  

    def lendBook(self,requestedBook):
        if requestedBook in self.availablebooks:
            print("The book you requested has now been borrowed")
            self.availablebooks.remove(requestedBook)
        else:
            print("Sorry the book you have requested is currently not in the library")
                  
        
    def addBook(self,returnedBook):
        self.availablebooks.append(returnedBook)
        print("Thanks for returning your borrowed book")            
        
class Student:
    def requestBook(self):
        print("Enter the name of the book you'd like to borrow>>")
        self.book=input()
        return self.book

    def returnBook(self):
        print("Enter the name of the book you'd like to return>>")
        self.book=input()
        return self.book

    
library=Library(["php","seo","python"])
student=Student()

print(""" ======LIBRARY MENU=======
              1. Display all available books
              2. Request a book
              3. Return a book
              4. Exit
              """)

choice=int(input("Enter Choice:"))
if choice==1:
    library.displayAvailablebooks()
elif choice==2:
    library.lendBook(student.requestBook())
elif choice==3:
    library.addBook(student.returnBook())
elif choice==4:
    quit()
 ======LIBRARY MENU=======
              1. Display all available books
              2. Request a book
              3. Return a book
              4. Exit
              
Enter Choice:3
Enter the name of the book you'd like to return>>
php
Thanks for returning your borrowed book
In [ ]:
#your choice
class Library:
    def __init__(self,listofbooks):
        self.availablebooks=listofbooks
    def displayAvailablebooks(self):
        print("The books we have in our library are as follows:")
        print("================================")
        for book in self.availablebooks:
            print(book)  

    def lendBook(self,requestedBook):
        if requestedBook in self.availablebooks:
            print("The book you requested has now been borrowed")
            self.availablebooks.remove(requestedBook)
        else:
            print("Sorry the book you have requested is currently not in the library")
                  
        
    def addBook(self,returnedBook):
        self.availablebooks.append(returnedBook)
        print("Thanks for returning your borrowed book")            
        
class Student:
    def requestBook(self):
        print("Enter the name of the book you'd like to borrow>>")
        self.book=input()
        return self.book

    def returnBook(self):
        print("Enter the name of the book you'd like to return>>")
        self.book=input()
        return self.book

    
library=Library(["php","seo","python"])
student=Student()

print(""" ======LIBRARY MENU=======
              1. Display all available books
              2. Request a book
              3. Return a book
              4. Exit
              """)

choice=int(input("Enter Choice:"))
if choice==1:
    library.displayAvailablebooks()
elif choice==2:
    library.lendBook(student.requestBook())
elif choice==3:
    library.addBook(student.returnBook())
elif choice==4:
    quit()
 ======LIBRARY MENU=======
              1. Display all available books
              2. Request a book
              3. Return a book
              4. Exit
              

01) Data Science, Deep Learning,& Machine Learning videos in telugu డేటా సైన్స్ ,మెషిన్ లెర్నింగ్ ట్రైనింగ్ వీడియోస్

02) BluePrisam videos in telugu బ్లూ ప్రిజం ట్రైనింగ్ వీడియో

03) Automation Anywhere videos in Telugu ఆటోమేషన్ ఎనీ వెర్ ట్రైనింగ్ వీడియోస్

04) RPA UI PATH videos in telugu UI పాత్ ట్రైనింగ్ వీడియోస్

05) AWS videos in Telugu అమెజాన్ వెబ్ సర్వీస్ అడ్మిన్ ట్రైనింగ్ వీడియోస్

06) DevOps training videos in telugu డెవోప్స్ ట్రైనింగ్ వీడియోస్

07) Digital marketing videos in telugu డిజిటల్ మార్కెటింగ్ ట్రైనింగ్ వీడియోస్

08) Angular 2 and 4 videos in telugu Angular 2 and 4 ట్రైనింగ్ వీడియోస్

09) Oracle WebLogic Server admin videos in Telugu ఒరాకిల్ వెబ్ లాజిక్ సర్వర్ అడ్మిన్

10) How to Improve Wordpress website speed for Google PageSpeed Insights videos in Telugu వర్డ్ ప్రెస్ వెబ్సైటు స్పీడ్ ని ఆప్టిమైజ్

11) please subscribe my youtube channel ప్లీజ్ subscribe my యూటుబ్ ఛానల్

12) Angular Js and NodeJs fast Track videos in telugu Angular and node js ఫాస్ట్ ట్రాక్ ఇన్ తెలుగు

13) FB Marketing 01 Create Page videos in telugu పేస్ బుక్ మార్కెటింగ్ ట్రైనింగ్ వీడియోస్

14) What is google adwords videos in Telugu గూగుల్ ఆడవర్డ్స్ ట్రైనింగ్ వీడియోస్

15) Data Science training Python videos in telugu పైథాన్ ప్రోగ్రామింగ్ వీడియోస్ ఫర్ డేటా సైన్స్ అండ్ మెషిన్ లెర్నింగ్

16) Python videos in telugu పైథాన్ ప్రోగ్రామింగ్ ట్రైనింగ్ వీడియోస్

17) please subscribe my youtube channel ప్లీజ్ subscribe my యూటుబ్ ఛానల్

18) How to verify website in bing webmaster Telugu - Bing webmaster tools Training Videos

19) yandex webmaster tools videos in Telugu

20) Introduction to google,bing, yandex,baidu webmasters videos in telugu

21) WordPress Training videos in telugu WordPress ట్రైనింగ్ వీడియోస్ in Telugu

22) Blogger training videos in telugu బ్లాగర్ ట్రైనింగ్ వీడియోస్ ఇన్ తెలుగు

23) Html and CSS training videos in telugu Html and Css ట్రైనింగ్ వీడియోస్ ఇన్ తెలుగు

24) What is Html 5 and new Elements In Telugu Html 5 ట్రైనింగ్ వీడియోస్ ఇన్ తెలుగు

25) SQL training videos in telugu SQL ట్రైనింగ్ వీడియోస్ ఇన్ తెలుగు

26) Javascript introduction And what is Javascript videos in telugu JavaScript ట్రైనింగ్ వీడియోస్ ఇన్ తెలుగు

27) About JQuery Training videos in Telugu JQuery ట్రైనింగ్ వీడియోస్ ఇన్ తెలుగు

28) AngularJS videos In Telugu AngularJs 1 ట్రైనింగ్ వీడియోస్ ఇన్ తెలుగు

29) What is Php and Uses Of php In Telugu PHP ట్రైనింగ్ వీడియోస్ ఇన్ తెలుగు

30) Ethical Hacking Demo in telugu ఎథికల్ హ్యాకింగ్ డెమో ఇన్ తెలుగు

31) Mean Stack demo in Telugu మీన్ స్టాక్ డెమో తెలుగు లో

32) please subscribe my youtube channel ప్లీజ్ subscribe my యూటుబ్ ఛానల్

No comments:

Post a Comment