ICP3 - PardhaSaradhi74/Python GitHub Wiki
In this module we dealt with introduction and hands-on experience on topics like classes and objects along with inheritance concept, Web scraping using BeautifulSoup and Requests library and creation of arrays, reshaping them and performing some operations using Numpy library.
Problem1: Class creation and Inheritance
Answer))Here i created a class named Employee with default constructor named init and a method called avg to calculate the average salary of employees given this can be done by taking each salary value from user and appending it to empty list and at end dividing it with count of employees. Similarly created child class named Fulltimeemployee and inherited parent class here as well as constructor and methods of parent are inherited using and at the end i printed the values of average of students.Below is attached working output screenshot.
Problem2: Webscraping
Answer))
Imported required libraries like requests and BeautifulSoup then opened the given link "https://en.wikipedia.org/wiki/Deep_learning" and parsed using html parser for scraping the content. Scraped title of the page and next found all attribute tags in the link and used for loop to go through each tag and extracted href content i.e.,links and finally saved those links in file and below is attached working output screenshot.
Problem3: Numpy
Answer))
In this imported numpy library and created a random vector of float values then reshaped it into desired array then checked for maximum value in each row and reshaped that array and replaced those maximum values with value zero using where clause. Below is attached working output screenshot.