-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
password generator and web scrapping program
- Loading branch information
1 parent
ff8d718
commit b42528f
Showing
5 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
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.') |
This file contains 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
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() |
This file contains 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
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) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import random | ||
r = random.randint(1, 9) | ||
print(r) |
This file contains 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
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')) |