Skip to content

Commit 3547478

Browse files
committed
10thCommit
1 parent 7f0f62d commit 3547478

File tree

5 files changed

+25
-2
lines changed

5 files changed

+25
-2
lines changed

7_Functions.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@
88
def sum(a, b):
99
print(a+b)
1010

11-
sum(2,3)
12-
11+
sum(2,3)

gfg1.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#map
2+
a,b,c,d = map(int, input().split(","))
3+
sum=a+b+c+d
4+
print(sum)

lamda.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# A lambda function, also known as an anonymous function,
2+
# is a small, inline function in Python that doesn't have a name.
3+
square = lambda x: x**2
4+
print(square(2))
5+

sieveOfEratosthene.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# The sieve of Eratosthenes is one of the most efficient
2+
# ways to find all primes smaller than n when n is smaller
3+
# than 10 million or so
4+
5+
def sieve(n):
6+
prime = [0 for i in range(1011)]
7+
for i in range(2, n+1):
8+
prime[i] == 0
9+
for j in range(i*i, n+1, i):
10+
prime[j] = 1
11+
for i in range(2, n+1):
12+
if prime[i] == 0:
13+
print(i, end=" ")
14+
sieve(500)

tempCodeRunnerFile.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2

0 commit comments

Comments
 (0)