Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
taskB_inlab
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
RISHABH GARG
taskB_inlab
Commits
be1fb313
Commit
be1fb313
authored
Aug 23, 2016
by
RISHABH GARG
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial Commit
parents
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
0 deletions
+45
-0
matrix.txt
matrix.txt
+7
-0
task1.py
task1.py
+7
-0
task2.py
task2.py
+5
-0
task3.py
task3.py
+26
-0
No files found.
matrix.txt
0 → 100644
View file @
be1fb313
5 5
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
16 17 18 19 20
21 22 23 24 25
\ No newline at end of file
task1.py
0 → 100644
View file @
be1fb313
def
function1
(
string1
,
string2
,
listVariable
):
String1
=
list
(
string1
)
String2
=
list
(
string2
)
res
=
zip
(
String1
,
String2
)
listVariable
.
extend
(
res
)
return
listVariable
\ No newline at end of file
task2.py
0 → 100644
View file @
be1fb313
def
function2
(
listVariable
,
n
):
buff
=
map
(
lambda
x
:
x
[
n
],
listVariable
)
lis
=
list
(
buff
)
return
lis
\ No newline at end of file
task3.py
0 → 100644
View file @
be1fb313
# def function3():
data
=
open
(
"matrix.txt"
)
size
=
data
.
readline
()
.
split
()
matrix
=
[[
None
]
*
int
(
size
[
1
])]
*
int
(
size
[
0
])
# for i in range(0,int(size[0])):
# matrix[i] = []
# print(matrix)
for
i
in
range
(
0
,
int
(
size
[
0
])):
matrix
[
i
]
=
data
.
readline
()
.
split
()
# print(matrix)
transpose
=
list
(
map
(
list
,
zip
(
*
matrix
)))
f
=
open
(
"transpose.txt"
,
"w"
)
f
.
write
(
size
[
1
]
+
" "
+
size
[
0
]
+
"
\n
"
)
for
i
in
range
(
0
,
int
(
size
[
1
])):
for
j
in
range
(
0
,
int
(
size
[
0
])):
f
.
write
(
transpose
[
i
][
j
]
+
" "
)
f
.
write
(
"
\n
"
)
f
.
close
()
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment