This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Employee: | |
| def __init__(self,name,age,exp,salary): | |
| self.name = name | |
| self.age = age | |
| self.exp = exp | |
| self.salary = salary | |
| class Developers(Employee): | |
| def __init__(self,name,age,exp,salary,level): | |
| super().__init__(name,age,exp,salary) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class A(object): | |
| def foo(self, x): | |
| print(f"executing foo({self}, {x})") | |
| @classmethod | |
| def class_foo(cls, x): | |
| print(f"executing class_foo({cls}, {x})") | |
| @staticmethod | |
| def static_foo(x): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Check_number : | |
| def even_or_odd(func) : | |
| def check(self, num) : | |
| func(self, num) | |
| if num % 2 == 0 : | |
| print(f'{num} is an EVEN Number') | |
| else : | |
| print(f'{num} is an ODD Number.') | |
| return check | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Data: | |
| def __init__(self, fname, lname): | |
| self.fname = fname | |
| self.lname = lname | |
| @property | |
| def name(self): | |
| print("Getter") | |
| return f"{self.fname} {self.lname}" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| Write a fun Python script that takes the user on a fun adventure by choosing different options for the path. | |
| ''' | |
| name = str(input("Enter Your Name\n")) | |
| print(f"{name} you are stuck in a forest. Your task is to get out from the forest without dieing") | |
| print("You are walking threw forest and suddenly a wolf comes in your way. Now You have two options.") | |
| print("1.Run 2. Climb The Nearest Tree ") | |
| user = int(input("Choose one option 1 or 2")) | |
| if user==1: | |
| print("You Died!!") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import streamlit as st | |
| st.write(''' # Hotel Review Sentiment Analysis ''') ## H1 Heading | |
| st.write("A Web app that detects whether an Review is Positive or Negative") ## subheading | |
| review = st.text_input("Enter Your Review...") ## Input Field | |
| Generate_pred = st.button("Predict Sentiment") ## Button |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ############ Importing Required Libraries ############# | |
| import pandas as pd | |
| import numpy as np | |
| import nltk | |
| import matplotlib.pyplot as plt | |
| import re | |
| import nltk | |
| nltk.download('stopwords') | |
| from nltk.corpus import stopwords | |
| from nltk.stem.porter import PorterStemmer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| Our task is to create a GUI threw which we can download youtube videos very easily. | |
| ''' | |
| from pytube import YouTube | |
| from tkinter.filedialog import * | |
| from tkinter.messagebox import * | |
| from tkinter import * | |
| from threading import * | |
| font = ('verdana', 20) | |
| file_size = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from tkinter import * | |
| from tkinter.messagebox import showinfo | |
| from bs4 import BeautifulSoup | |
| import requests | |
| headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3'} | |
| def action(): | |
| ### Code For Receiving Query | |
| query=textF.get() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from selenium import webdriver | |
| from selenium.webdriver.common.keys import Keys | |
| PATH = 'chromedriver.exe' ##Same Directory as Python Program | |
| driver = webdriver.Chrome(executable_path=PATH) | |
| driver.get("https://www.facebook.com/") | |
| def login(id,password): | |
| email = driver.find_element_by_id("email") | |
| email.send_keys(id) |