Skip to content

Commit d57519e

Browse files
committed
just practice website
1 parent f23bb99 commit d57519e

File tree

11 files changed

+183
-0
lines changed

11 files changed

+183
-0
lines changed

advancedpython2/01_problem/01_problem.py

Whitespace-only changes.

advancedpython2/01_problem/requirements.txt

Whitespace-only changes.

advancedpython2/01_venv.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Importance of Virtual Environment
2+
"""
3+
This script demonstrates the importance of using a virtual environment in Python projects.
4+
5+
A virtual environment is a self-contained directory that contains a Python installation for a particular version of Python, plus a number of additional packages. It allows you to manage dependencies for different projects separately, avoiding conflicts between them.
6+
7+
Key points:
8+
- Isolate project dependencies
9+
- Avoid version conflicts
10+
- Simplify dependency management
11+
- Facilitate reproducibility
12+
13+
Usage:
14+
1. Create a virtual environment:
15+
python -m venv <env_name>
16+
17+
2. Activate the virtual environment:
18+
- On Windows: <env_name>\Scripts\activate
19+
- On Unix or MacOS: source <env_name>/bin/activate
20+
21+
3. Install dependencies within the virtual environment:
22+
pip install <package_name>
23+
24+
4. Deactivate the virtual environment when done:
25+
deactivate
26+
"""

advancedpython2/02_lambda.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
def sq(n):
2+
return n * n
3+
4+
sq = lambda n: n * n
5+
6+
sum = lambda a, b, c: a + b + c
7+
8+
print(sq(6))
9+
print(sum(6,6,7))

advancedpython2/03_join.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
lists = ["Apple", "Banana", "Orange"]
2+
fn = " :: ".join(lists)
3+
print(fn)

advancedpython2/04_format.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
a = "{1} in need is {0} {2}".format("Friend", "friend", "indeed")
2+
print(a)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
from functools import reduce
2+
3+
S = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
4+
5+
sq = map(lambda x: x * x, S)
6+
7+
print(S)
8+
print(list(sq))
9+
10+
11+
def even(n):
12+
return True if n % 2 == 0 else False
13+
14+
15+
print(list(filter(even, S)))
16+
17+
18+
def add(a, b):
19+
return a + b
20+
21+
22+
print(reduce(add, S))

advancedpython2/reduce method.png

58.1 KB
Loading

app/9694447-hd_1920_1080_25fps.mp4

10.7 MB
Binary file not shown.

app/index.html

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=0, initial-scale=1.0">
7+
<title>Document</title>
8+
<style>
9+
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&family=Noto+Sans+JP:wght@100..900&family=Oswald:wght@200..700&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
10+
</style>
11+
<link rel="stylesheet" href="st.css">
12+
</head>
13+
14+
<body>
15+
<video src="./9694447-hd_1920_1080_25fps.mp4" class="vid" loop autoplay muted></video>
16+
17+
<div class="co">
18+
<div class="nav">
19+
<h1 class="r">Sarthak.</h1>
20+
<ul class="l">
21+
<li>Introduction</li>
22+
<li>Portfolio</li>
23+
<li>Reach Out</li>
24+
</ul>
25+
</div>
26+
<div class="sec">
27+
<h1>Hello World</h1>
28+
<p>I am new to world, here for making new friends</p>
29+
</div>
30+
</div>
31+
</body>
32+
33+
</html>

0 commit comments

Comments
 (0)