Skip to content

Commit

Permalink
updated projects
Browse files Browse the repository at this point in the history
  • Loading branch information
dracu-lah committed Nov 28, 2022
1 parent 7bd673c commit 35a56a9
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 0 deletions.
8 changes: 8 additions & 0 deletions 14.scrape-table-from-website/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import urllib.request
import pandas as pd
url="https://www.w3schools.com/html/html_tables.asp"

with urllib.request.urlopen(url) as i:
html = i.read()
data = pd.read_html(html)[0]
print(data.head())
Binary file added 15.extract-text-from-pdf/aivmm.pdf
Binary file not shown.
6 changes: 6 additions & 0 deletions 15.extract-text-from-pdf/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import PyPDF2

pdf= open("aivmm.pdf", "rb")
reader = PyPDF2.PdfFileReader(pdf)
page = reader.getPage(0)
print(page.extractText())
7 changes: 7 additions & 0 deletions 16.reversing-a-string/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# The first character in the string has index 0, and the last character has index n-1, where n is the length of the string. The string slicing operator “::” reads all the characters of the string, and -1, in the end, reverses the order of the characters. This is how we can reverse a string

def reverse_string(string):
return string[::-1]

a = input("Enter a string :")
print(reverse_string(a))
8 changes: 8 additions & 0 deletions 17.sequence-matcher/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from difflib import SequenceMatcher

text1 = input("Enter text 1 : ")
text2 = input("Enter text 2 : ")

sequence_score = SequenceMatcher(None, text1, text2).ratio()

print(f"Both are {sequence_score*100} % similar")

0 comments on commit 35a56a9

Please sign in to comment.