Skip to content

Commit a25a11c

Browse files
committed
Merge origin/main into local main
2 parents 023cc29 + f0d6f14 commit a25a11c

File tree

7 files changed

+27
-9
lines changed

7 files changed

+27
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Python Basic to Advance
22

3-
This repository contains my journey from beginner to advanced Python programs.
3+
This repository showcases my journey from beginner to advanced Python programs.
44
It includes examples of data types, input handling, string manipulation, and more.
55

66
## 🚀 Run the Code

arithmetic_operators.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@
2929
weight = float(input("Enter weight (kg): "))
3030
height = float(input("Enter height (m): "))
3131

32-
print("BMI =", (weight / (height**2)))
33-
print("BMI =", round(weight / (height**2), 1))
32+
print("BMI =", (weight / (height**2)))#Body Mass Index.
33+
34+
print("BMI =", round(weight / (height**2), 2))#round(number, ndigits)

bitwise_operators.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
a = 2 # binary: 10
22
b = 4 # binary: 100
3+
#100=(1*2^2)+(0*2^1)+(0* 2^0)=4+0+0=4
34

45
print(a >> 1) # right shift
56
print(a << 1) # left shift
67
print(a & b) # AND
78
print(a | b) # OR
8-
print(a ^ b) # XOR
9+
print(a ^ b) # XOR
10+
print(~b)

exercise_2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
number=input("Enter a two digit number:")
22
sum=int(number[0])+int(number[1])
3-
print(sum)
3+
print(sum)

f_string.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# Define variables
1+
#- Stands for formatted string literal.
2+
23
name = "Jenny" # Person's name
34
age = 30 # Person's age
45
height = 1.6 # Person's height in meters

git

Whitespace-only changes.

index.html

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,24 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<title>Python Basic to Advance</title>
4+
<title>Python Basic to Advance</title>
55
</head>
66
<body>
7-
<h1>Hello Amrata!</h1>
8-
<p>This is my GitHub Pages demo site.</p>
7+
<h1>Hello Amrata!</h1>
8+
<p>This is my GitHub Pages demo site.</p>
9+
10+
<section style="background:#f9f9f9; padding:20px; border-radius:8px; box-shadow:0 0 5px rgba(0,0,0,0.1);">
11+
<h2 style="color:#2c3e50;">🧪 Sample Python Output</h2>
12+
<pre style="font-family:monospace; font-size:14px; color:#333;">
13+
<class 'float'>
14+
<class 'complex'>
15+
<class 'dict'>
16+
<class 'bool'>
17+
<class 'str'>
18+
<class 'list'>
19+
<class 'tuple'>
20+
<class 'set'>
21+
</pre>
22+
</section>
923
</body>
1024
</html>

0 commit comments

Comments
 (0)