




















































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A Python script that utilizes BeautifulSoup, json, requests, and sqlite3 libraries for web scraping, data processing, and database interaction. The script fetches data from a website, extracts specific information using BeautifulSoup, processes the data using json, and stores it in an SQLite database.
Typology: Summaries
1 / 92
This page cannot be seen from the preview
Don't miss anything!





















































































$ python --version
$ python helloworld.py
a = 1
a = 1 a = 'Hello World' a = [1, 2, 3] a = [1.2, 'Hello', 'W', 2]
x = 2
1 < x < 3 # True 10 < x < 20 # False 3 > x <= 2 # True 2 == x < 4 # True
'good' in 'this is a greate example' # F alse 'good' not in 'this is a greate example' # True
'ϴYXVɾGчMАYOLMВR
if condition1 : indentedStatementBlockForTrueCondition elif condition2 : indentedStatementBlockForFirstTrueCondition elif condition3 : indentedStatementBlockForFirstTrueCondition elif condition4 : indentedStatementBlockForFirstTrueCondition else : indentedStatementBlockForEachConditionFalse
7[MXGLŷGEWI
*SVŷMR
for iterating_var in sequence: statements(s)
while expression: statement(s)
count = 0 while (count < 9): print 'The count is:', count count = count + 1
print "Good bye!"
The count is: 0 The count is: 1 The count is: 2 The count is: 3 The count is: 4 The count is: 5 The count is: 6 The count is: 7 The count is: 8 Good bye!
,ɧQ
def functionname(param, param2,..): statements(s)
None
sum(b = 1, a = 10)
<мPʁGLYЦM
str1 = "Hello" str2 = 'world'
paragraph = """This is line 1 This is line 2 This is line 3"""
2РMGLYЦM
str = str1 + " " + str
8VɴGL\YϴXGLYЦMGSR
str = 'Hello world' newstr = str.replace('Hello', 'Bye') print newstr (Sҿ hiӅn thӍ chuәi "Bye world" trên màn hình)
8ɳQZКXVɴGLYЦMGSR
str = 'Hello world' print str.find('world') (hiӅn thӍ 6)
print str.find('Bye'); (hiӅn thӍ -1)
8ɨGLGLYЦM
str = 'Hello world' print str.split(' ') (Trҥ vӃ mӛt mҥng có 2 phҩn tӯ là 2 chuәi "Hello" và "world")
8VMQOʁXрOLSЂRKXVϾRK