Variables

Tue 09 December 2025
num = 20
print(id(num))
9754472
x = 20 
y = 50
z = 100
print(x);print(y);print(z)
20
50
100
phy = 89
chem = 86
maths = 90
marks_obtained = phy + chem + maths
mark = (marks_obtained * 100) / 300
print(mark)
88.33333333333333
x = 80 
y = 99.99
name = 'Radhika'
print(x); print(y …

Category: Python basics

Read More

Variables And Data Types

Tue 09 December 2025
integer_var = 42
float_var = 3.14
string_var = "Hello, Python!"
boolean_var = True
none_var = None


print(type(integer_var))  
print(float_var, "converted to int:", int(float_var))  
print(str(integer_var) + " is now a string")  
print(str(string_var))

if(boolean_var):
    print("Its true")
else:
    print("Its false")


a, b, c = 1, 2.0, "three"
<class 'int …

Category: Python basics

Read More

Web Scraper With Data Storage

Tue 09 December 2025
import requests
from bs4 import BeautifulSoup
import sqlite3
def scrape_quotes():
    url = "http://quotes.toscrape.com"
    response = requests.get(url)
    soup = BeautifulSoup(response.text, "html.parser")
    quotes = soup.find_all("span", class_="text")

    conn = sqlite3.connect("quotes.db")
    c = conn.cursor()
    c.execute("CREATE TABLE IF NOT EXISTS quotes (text TEXT, author …

Category: misc

Read More
Page 4 of 4

« Prev