Skip to content

Commit 3a751a5

Browse files
committed
first five in 10
1 parent 81b147a commit 3a751a5

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

solutions.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
2+
3+
def one():
4+
return([x for x in range(2000,3200) if x%7==0 and x%5 !=0])
5+
6+
l=[]
7+
for i in range(2000, 3201):
8+
if (i%7==0) and (i%5!=0):
9+
l.append(str(i))
10+
11+
12+
def two(n):
13+
ans = 1
14+
for i in range(1,n+1):
15+
ans = ans*i
16+
return(ans)
17+
18+
def three(n):
19+
ans = dict()
20+
for i in range(1,n+1):
21+
ans[i]=i*i
22+
return(ans)
23+
24+
three(8)
25+
26+
def four(string_of_numbers):
27+
ans = string_of_numbers.split(",")
28+
ans2 = tuple(ans)
29+
return([ans,ans2])
30+
31+
string_of_numbers = "3,6,7,8,12"
32+
four(string_of_numbers)
33+
34+
class five(object):
35+
def __init__(self):
36+
self.text = ""
37+
def getString(self,input):
38+
self.text = input
39+
def shoutString(self):
40+
print(self.text.upper())
41+
42+
five_text = five()
43+
five_text.getString("im learning python quickly")
44+
five_text.shoutString()
45+
46+
47+

0 commit comments

Comments
 (0)