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
HARSH DEPAL
taskB_inlab
Commits
41769ec4
Commit
41769ec4
authored
Aug 23, 2016
by
HARSH DEPAL
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added task1,task2,task3
parent
df76fe4d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
0 deletions
+34
-0
task1.py
task1.py
+9
-0
task2.py
task2.py
+3
-0
task3.py
task3.py
+22
-0
No files found.
task1.py
0 → 100644
View file @
41769ec4
def
function1
(
string1
,
string2
,
listVariable
)
:
new_tuple
=
list
(
map
(
lambda
x
,
y
:
(
x
,
y
),
list
(
string1
),
list
(
string2
)))
listVariable
.
extend
(
new_tuple
)
return
listVariable
list1
=
[
1
,
2
,
3
,
4
,
5
]
print
(
list1
)
list2
=
function1
(
"Tarun"
,
"CSE"
,
list1
)
print
(
list2
)
task2.py
0 → 100644
View file @
41769ec4
def
function2
(
listVariable
,
n
)
:
print
(
list
(
map
(
lambda
x
:
x
[
n
],
listVariable
)))
return
sorted
(
listVariable
,
key
=
lambda
x
:
x
[
n
]
)
task3.py
0 → 100644
View file @
41769ec4
import
sys
file
=
open
(
'matrix.txt'
,
"r"
)
output
=
open
(
'transpose.txt'
,
"w"
)
filedata
=
file
.
readlines
()
row
,
col
=
map
(
int
,
filedata
[
0
]
.
split
())
filedata
.
pop
(
0
)
output
.
write
(
str
(
col
)
+
" "
+
str
(
row
)
+
"
\n
"
)
A
,
r
,
c
=
[[
None
for
x
in
range
(
col
)]
for
y
in
range
(
row
)]
,
0
,
0
AT
=
[[
None
for
x
in
range
(
row
)]
for
y
in
range
(
col
)]
for
line
in
filedata
:
c
=
0
for
element
in
line
.
split
():
A
[
r
][
c
]
=
element
c
=
c
+
1
r
=
r
+
1
for
r
in
range
(
col
):
for
c
in
range
(
row
):
AT
[
r
][
c
]
=
A
[
c
][
r
]
output
.
write
(
str
(
AT
[
r
][
c
])
+
" "
)
output
.
write
(
"
\n
"
)
file
.
close
();
output
.
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