Skip to content

Commit

Permalink
password generator and web scrapping program
Browse files Browse the repository at this point in the history
  • Loading branch information
rakeshlinux committed Apr 15, 2018
1 parent ff8d718 commit b42528f
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 0 deletions.
3 changes: 3 additions & 0 deletions age.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
print('What is your age?') # ask for their age
myAge = input()
print('You will be ' + str(int(myAge) + 1) + ' in a year.')
7 changes: 7 additions & 0 deletions for_1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
def pyramid():
n = int(input("Enter any number"))
for i in range(1,n+1):
for j in range(1,i+1):
print(j,end=" ")
print()
pyramid()
7 changes: 7 additions & 0 deletions pass.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import random
chars ="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&*()_+}{"
length = int(input("Enter password length "))
password=""
for i in range(length+1):
password += random.choice(chars)
print(password)
3 changes: 3 additions & 0 deletions random_number.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import random
r = random.randint(1, 9)
print(r)
12 changes: 12 additions & 0 deletions web_scraping.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#purpose : simple example of web scrapping
#author : rakesh kumar
#licence : MIT
from bs4 import BeautifulSoup
import requests

url = input("Enter a website to extract the URL's from: ")
r = requests.get("http://" +url)
data = r.text
soup = BeautifulSoup(data,"html.parser")
for link in soup.find_all('a'):
print(link.get('href'))

0 comments on commit b42528f

Please sign in to comment.