Skip to content

Instantly share code, notes, and snippets.

View saipraveenkondapalli's full-sized avatar

Sai Praveen Kondapalli saipraveenkondapalli

View GitHub Profile
@saipraveenkondapalli
saipraveenkondapalli / Web Scrapping Covid 19.py
Last active May 30, 2020 05:04
web scrapping usingg Beautifulsoup in python from wikipedia.
import urllib.request as req
from bs4 import BeautifulSoup
import pandas as pd
import xlwt.Workbook
# you have to understand the layout of the wikipedia page for this code. visit the site and inspect the page html code
# our goal is to extract the data form the web page and save the country name ,active cases etc, save them in a list
# and print the data in a tabular form using pandas and also write the data to a excel file
url = 'https://en.wikipedia.org/wiki/COVID-19_pandemic_by_country_and_territory'
html = req.urlopen(url)
@saipraveenkondapalli
saipraveenkondapalli / corona cases india.py
Created May 24, 2020 10:34
basic webscrapping for corona virus in india
import urllib.request
from bs4 import BeautifulSoup
url = urllib.request.urlopen('https://www.mohfw.gov.in/')
soup = BeautifulSoup(url, 'html.parser')
cases = soup.findAll('li', class_= 'bg-blue')
active_cases = cases[0].strong.text
cured = soup.findAll('li', class_= 'bg-green')
discharged= cured[0].strong.text
deceased = soup.findAll('li', class_ = 'bg-red')
import random
print('''Winning Rules as follows :
Rock vs paper-> paper wins
Rock vs scissor-> Rock wins
paper vs scissor-> scissor wins.
''')
def user():
@saipraveenkondapalli
saipraveenkondapalli / prime factors of a number in python.py
Last active April 27, 2020 18:47
prime factors of a number,using definatons,ehile loop and for loop
def prime_number(n):
for n in range(2, n + 1):
if n > 1:
for y in range(2, n):
if n % y == 0:
break
else:
prime.append(n)
@saipraveenkondapalli
saipraveenkondapalli / python password generator
Last active April 27, 2020 18:46
random pssword generator between 10 and 18 characters
import string
import random
password_length = random.randint(10, 18)
print("password of length between 8 and 15 will be generated")
password = ''
while password_length > 0:
words_and_Digits = string.ascii_letters + string.digits + "!@#$%^&*()?_+*-"
@saipraveenkondapalli
saipraveenkondapalli / Number guessing game in python
Last active January 25, 2022 10:22
Number guessing game in python using def ,while loop, random library.hope you like it.
# random number guessing game
# import random library
from random import randint
def user_name():
name = str(input("what is your name?"))
return name.upper()
@saipraveenkondapalli
saipraveenkondapalli / Hangaman 1.0.py
Last active April 18, 2020 16:34
hangaman in python,with words importing from a file
'''
let's design the code for hangman.
'''
import time
import random
def secret_word():