File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change
1
+ ################# question 1 ###################
2
+ def q1_div (x ,y ):
3
+ l = []
4
+ for i in range (x ,y ):
5
+ if (i % 7 == 0 ) and (i % 5 != 0 ):
6
+ l .append (str (i ))
7
+ l_cont = ',' .join (l )
8
+ print (type (l_cont ),(l_cont ))
9
+
10
+ ################# question 2 ###################
11
+ def q2_factorial (x ):
12
+ for i in range (x - 1 ,1 ,- 1 ):
13
+ x = x * i
14
+ print (x )
15
+ def q2_factorial_s (x ):
16
+ if x == 0 :
17
+ return 1
18
+ else :
19
+ return x * q2_factorial_s (x - 1 )
20
+
21
+ ################# question 3 ###################
22
+ def q3_sqr (x ):
23
+ d = {}
24
+ for i in range (1 ,x + 1 ):
25
+ d [i ]= i * i
26
+ return (d )
27
+
28
+ ################# question 4 ###################
29
+ def q4_listtuple_s ():
30
+ values = input ()
31
+ l = values .split ("," )
32
+ t = tuple (l )
33
+ print (l )
34
+ print (t )
35
+
36
+
37
+ if __name__ == "__main__" :
38
+ q4_listtuple_s ()
You can’t perform that action at this time.
0 commit comments