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
SINGH SOURABH BHAGWAN
taskB_inlab
Commits
0f54af9d
Commit
0f54af9d
authored
Aug 23, 2016
by
UDDESHYA
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
task3 done
parent
8226e88d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
2 deletions
+44
-2
matrix.txt
matrix.txt
+4
-0
matrix.txt~
matrix.txt~
+0
-0
task2.py
task2.py
+2
-2
task3.py
task3.py
+33
-0
transpose.txt
transpose.txt
+5
-0
No files found.
matrix.txt
0 → 100644
View file @
0f54af9d
3 4
1 2 3 4
5 6 7 8
2 5 6 8
matrix.txt~
0 → 100644
View file @
0f54af9d
task2.py
View file @
0f54af9d
def
function2
(
listVariable
,
n
):
l
=
list
(
map
(
lambda
elem
:
elem
[
n
-
1
],
listVariable
))
l
=
list
(
map
(
lambda
elem
:
elem
[
n
],
listVariable
))
print
(
l
)
l
.
sort
()
return
l
li
=
[(
22
,
3
),(
2634
,
4642
),(
235
,
32
)]
print
(
function2
(
li
,
2
))
\ No newline at end of file
function2
(
li
,
1
)
\ No newline at end of file
task3.py
0 → 100644
View file @
0f54af9d
def
function2
(
listVariable
,
n
):
l
=
list
(
map
(
lambda
elem
:
elem
[
n
],
listVariable
))
return
l
f
=
open
(
'matrix.txt'
,
'r'
)
dim
=
next
(
f
)
.
split
()
dim
[
0
]
=
int
(
dim
[
0
])
dim
[
1
]
=
int
(
dim
[
1
])
r
=
dim
[
0
]
c
=
dim
[
1
]
mat
=
[[
None
]
*
c
]
*
r
for
i
in
range
(
0
,
r
):
ml
=
[]
for
x
in
next
(
f
)
.
split
():
ml
.
append
(
int
(
x
))
mat
[
i
]
=
ml
t
=
open
(
'transpose.txt'
,
'w'
)
dim
=
[
c
,
r
]
k
=
''
.
join
(
str
(
x
)
+
' '
for
x
in
dim
)
t
.
write
(
k
+
'
\n
'
)
mat_tr
=
[]
for
j
in
range
(
0
,
c
):
row
=
function2
(
mat
,
j
)
mat_tr
.
append
(
row
)
s
=
''
.
join
(
str
(
y
)
+
' '
for
y
in
row
)
t
.
write
(
s
+
'
\n
'
)
\ No newline at end of file
transpose.txt
0 → 100644
View file @
0f54af9d
4 3
1 5 2
2 6 5
3 7 6
4 8 8
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