Files - Python Questions and Answers - Sanfoundry

Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

3/27/2019 List Comprehension Interview Questions and Answers - Sanfoundry

(//www.sanfoundry.com)

Python Multiple Choice Questions | MCQs | Quiz

Practice Python questions and answers for interviews, campus placements, online tests, aptitude tests, quizzes and competitive exams.

Get Started

• Variable Names (https://www.sanfoundry.com/python-questions-answers-variable-names/)


• Basic Operators (https://www.sanfoundry.com/python-mcqs-basic-operators/)
• Core Data Types (https://www.sanfoundry.com/python-mcqs-core-datatypes/)
• Numeric Types (https://www.sanfoundry.com/python-questions-answers-numeric-types/)
• Precedence Associativity-1 (https://www.sanfoundry.com/python-questions-answers-precedence-associativity-1/)
• Precedence Associativity-2 (https://www.sanfoundry.com/python-questions-answers-precedence-associativity-2/)
• Bitwise - 1 (https://www.sanfoundry.com/python-questions-answers-bitwise-1/)
• Bitwise - 2 (https://www.sanfoundry.com/python-questions-answers-bitwise-2/)
• Boolean (https://www.sanfoundry.com/python-questions-answers-boolean/)
• Formatting - 1 (https://www.sanfoundry.com/python-questions-answers-formatting-1/)
https://www.sanfoundry.com/python-questions-answers-list-comprehension-1/ 1/15
3/27/2019 List Comprehension Interview Questions and Answers - Sanfoundry
• Formatting - 2 (https://www.sanfoundry.com/python-questions-answers-formatting-2/)
• Advanced Formatting (https://www.sanfoundry.com/python-questions-answers-advanced-formatting/)
• Decorators (https://www.sanfoundry.com/python-questions-answers-decorators/)
• While & For Loops - 1 (https://www.sanfoundry.com/python-questions-answers-while-and-for-loops-1/)
• While & For Loops - 2 (https://www.sanfoundry.com/advanced-python-questions-answers/)
• While & For Loops - 3 (https://www.sanfoundry.com/tough-python-questions-answers/)
• While & For Loops - 4 (https://www.sanfoundry.com/python-questions-answers-freshers/)
• While & For Loops - 5 (https://www.sanfoundry.com/python-questions-answers-experienced/)
• While & For Loops - 6 (https://www.sanfoundry.com/python-technical-questions-answers/)
• Strings - 1 (https://www.sanfoundry.com/python-mcqs-strings-1/)
• Strings - 2 (https://www.sanfoundry.com/advanced-python-interview-questions-answers/)
• Strings - 3 (https://www.sanfoundry.com/python-technical-interview-questions-answers/)
• Strings - 4 (https://www.sanfoundry.com/python-coding-questions-answers/)
• Strings - 5 (https://www.sanfoundry.com/basic-python-questions-answers/)
• Strings - 6 (https://www.sanfoundry.com/python-quiz/)
• Strings - 7 (https://www.sanfoundry.com/python-quiz-online/)
• Strings - 8 (https://www.sanfoundry.com/python-multiple-choice-questions-answers/)
• Strings - 9 (https://www.sanfoundry.com/python-mcqs/)
• Strings - 10 (https://www.sanfoundry.com/python-test/)
• Strings - 11 (https://www.sanfoundry.com/python-online-test/)
• Strings - 12 (https://www.sanfoundry.com/python-problems/)
• Strings - 13 (https://www.sanfoundry.com/python-question-bank/)
• Lists - 1 (https://www.sanfoundry.com/python-mcqs-lists-1/)
• Lists - 2 (https://www.sanfoundry.com/python-coding-interview-questions-answers/)
• Lists - 3 (https://www.sanfoundry.com/python-programming-questions-answers/)
• Lists - 4 (https://www.sanfoundry.com/python-programming-interview-questions-answers/)
• Lists - 5 (https://www.sanfoundry.com/python-question-papers/)
• Lists - 6 (https://www.sanfoundry.com/python-questions-answers-lists-6/)
• Lists - 7 (https://www.sanfoundry.com/python-questions-answers-lists-7/)
• List Comprehension (https://www.sanfoundry.com/python-questions-answers-list-comprehension/)
• List Comprehension - 1 (https://www.sanfoundry.com/python-questions-answers-list-comprehension-1/)
• List Comprehension - 2 (https://www.sanfoundry.com/python-questions-answers-list-comprehension-2/)
• Matrix List Comprehension (https://www.sanfoundry.com/python-questions-answers-matrix-list-comprehension/)
• Tuples - 1 (https://www.sanfoundry.com/python-mcqs-tuples/)
• Tuples - 2 (https://www.sanfoundry.com/python-questions-answers-tuples-2/)
• Tuples - 3 (https://www.sanfoundry.com/python-questions-answers-tuples-3/)
• Sets - 1 (https://www.sanfoundry.com/python-questions-answers-sets-1/)
• Sets - 2 (https://www.sanfoundry.com/python-questions-answers-sets-2/)
• Sets - 3 (https://www.sanfoundry.com/python-questions-answers-sets-3/)
https://www.sanfoundry.com/python-questions-answers-list-comprehension-1/ 2/15
3/27/2019 List Comprehension Interview Questions and Answers - Sanfoundry
• Sets - 4 (https://www.sanfoundry.com/python-questions-answers-sets-4/)
• Sets - 5 (https://www.sanfoundry.com/python-questions-answers-sets-5/)
• Dictionary - 1 (https://www.sanfoundry.com/python-mcqs-dictionary-1/)
• Dictionary - 2 (https://www.sanfoundry.com/python-questions-answers-dictionary-2/)
• Dictionary - 3 (https://www.sanfoundry.com/python-questions-answers-dictionary-3/)
• Dictionary - 4 (https://www.sanfoundry.com/python-questions-answers-dictionary-4/)
• Built-in Functions - 1 (https://www.sanfoundry.com/python-questions-answers-built-in-functions-1/)
• Built-in Functions - 2 (https://www.sanfoundry.com/python-questions-answers-built-in-functions-2/)
• Built-in Functions - 3 (https://www.sanfoundry.com/python-questions-answers-built-in-functions-3/)
• Function - 1 (https://www.sanfoundry.com/python-mcqs-function-1/)
• Function - 2 (https://www.sanfoundry.com/python-questions-entrance-exams/)
• Function - 3 (https://www.sanfoundry.com/python-questions-campus-interview/)
• Function - 4 (https://www.sanfoundry.com/python-questions-answers-function-4/)
• Argument Passing - 1 (https://www.sanfoundry.com/python-puzzles/)
• Argument Passing - 2 (https://www.sanfoundry.com/tricky-python-questions-answers/)
• Global vs Local Variables-1 (https://www.sanfoundry.com/python-questions-answers-global-local-variables-1/)
• Global vs Local Variables-2 (https://www.sanfoundry.com/python-questions-answers-global-local-variables-2/)
• Recursion (https://www.sanfoundry.com/python-questions-answers-recursion/)
• Shallow Copy vs Deep Copy (https://www.sanfoundry.com/python-questions-answers-shallow-copy-deep-copy/)
• Functional Tools (https://www.sanfoundry.com/python-questions-answers-functional-programming-tools/)
• Mapping Functions - 1 (https://www.sanfoundry.com/python-interview-questions-answers/)
• Mapping Functions - 2 (https://www.sanfoundry.com/tough-python-interview-questions-answers/)
• Mapping Functions - 3 (https://www.sanfoundry.com/python-interview-questions-answers-freshers/)
• Python Modules (https://www.sanfoundry.com/python-questions-answers-modules/)
• Math - 1 (https://www.sanfoundry.com/python-objective-questions-answers/)
• Math - 2 (https://www.sanfoundry.com/python-developer-questions-answers/)
• Math - 3 (https://www.sanfoundry.com/python-developer-interview-questions-answers/)
• Datetime Module - 1 (https://www.sanfoundry.com/python-questions-answers-datetime-module-1/)
• Datetime Module - 2 (https://www.sanfoundry.com/python-questions-answers-datetime-module-2/)
• Random Module - 1 (https://www.sanfoundry.com/python-questions-answers-random-module/)
• Random Module - 2 (https://www.sanfoundry.com/python-aptitude-test-questions/)
• Sys Module (https://www.sanfoundry.com/python-questions-answers-sys-module/)
• Operating System (https://www.sanfoundry.com/python-exam-questions-answers/)
• Turtle Module - 1 (https://www.sanfoundry.com/python-questions-answers-turtle-module-1/)
• Turtle Module - 2 (https://www.sanfoundry.com/python-questions-answers-turtle-module-2/)
• Turtle Module - 3 (https://www.sanfoundry.com/python-questions-answers-turtle-module-3/)
• Pickle Module (https://www.sanfoundry.com/python-questions-answers-pickle-module/)
• Regular Expressions (https://www.sanfoundry.com/python-questions-answers-regular-expressions/)
• Regular Expressions - 1 (https://www.sanfoundry.com/python-questions-answers-regular-expressions-1/)
https://www.sanfoundry.com/python-questions-answers-list-comprehension-1/ 3/15
3/27/2019 List Comprehension Interview Questions and Answers - Sanfoundry
• Regular Expressions - 2 (https://www.sanfoundry.com/python-questions-answers-regular-expressions-2/)
• Regular Expressions - 3 (https://www.sanfoundry.com/python-questions-answers-regular-expressions-3/)
• Regular Expressions - 4 (https://www.sanfoundry.com/python-questions-answers-regular-expressions-4/)
• Regular Expressions - 5 (https://www.sanfoundry.com/python-questions-answers-regular-expressions-5/)
• Files - 1 (https://www.sanfoundry.com/python-mcqs-files-1/)
• Files - 2 (https://www.sanfoundry.com/python-certification-questions-answers/)
• Files - 3 (https://www.sanfoundry.com/python-scripting-questions-answers/)
• Files - 4 (https://www.sanfoundry.com/python-scripting-interview-questions-answers/)
• Files - 5 (https://www.sanfoundry.com/python-written-test-questions-answers/)
• Operator Overloading (https://www.sanfoundry.com/python-interview-questions-answers-experienced/)
• Classes & Objects - 1 (https://www.sanfoundry.com/python-questions-answers-classes-objects-1/)
• Classes & Objects - 2 (https://www.sanfoundry.com/python-questions-answers-classes-objects-2/)
• Inheritance - 1 (https://www.sanfoundry.com/python-questions-answers-inheritance-1/)
• Inheritance - 2 (https://www.sanfoundry.com/python-questions-answers-inheritance-2/)
• Polymorphism (https://www.sanfoundry.com/python-questions-answers-polymorphism/)
• Encapsulation (https://www.sanfoundry.com/python-questions-answers-encapsulation/)
• Exception Handling - 1 (https://www.sanfoundry.com/python-questions-answers-exception-handling/)
• Exception Handling - 2 (https://www.sanfoundry.com/python-questions-answers-exception-handling-2/)
• Exception Handling - 3 (https://www.sanfoundry.com/python-questions-answers-exception-handling-3/)

Best Reference Books

Python Books (https://www.sanfoundry.com/best-reference-books-python-programming/)

Python Programming Tests


Certification Test (https://rank.sanfoundry.com/python-programming-certification-test/)
Internship Test (https://rank.sanfoundry.com/python-programming-internship-test/)
Job Test (https://rank.sanfoundry.com/python-programming-job-test/)
All Tests (https://rank.sanfoundry.com/python-programming-tests/)
Top Rankers (https://rank.sanfoundry.com/top-rankers-python-programming/)
Practice Test 1 (https://rank.sanfoundry.com/python-programming-practice-test-1/)
Practice Test 2 (https://rank.sanfoundry.com/python-programming-practice-test-2/)
Practice Test 3 (https://rank.sanfoundry.com/python-programming-practice-test-3/)
Practice Test 4 (https://rank.sanfoundry.com/python-programming-practice-test-4/)
Practice Test 5 (https://rank.sanfoundry.com/python-programming-practice-test-5/)
Practice Test 6 (https://rank.sanfoundry.com/python-programming-practice-test-6/)
https://www.sanfoundry.com/python-questions-answers-list-comprehension-1/ 4/15
3/27/2019 List Comprehension Interview Questions and Answers - Sanfoundry
Practice Test 7 (https://rank.sanfoundry.com/python-programming-practice-test-7/)
Practice Test 8 (https://rank.sanfoundry.com/python-programming-practice-test-8/)
Practice Test 9 (https://rank.sanfoundry.com/python-programming-practice-test-9/)
Practice Test 10 (https://rank.sanfoundry.com/python-programming-practice-test-10/)
Mock Test 1 (https://rank.sanfoundry.com/python-programming-mock-test-1/)
Mock Test 2 (https://rank.sanfoundry.com/python-programming-mock-test-2/)
Mock Test 3 (https://rank.sanfoundry.com/python-programming-mock-test-3/)
Mock Test 4 (https://rank.sanfoundry.com/python-programming-mock-test-4/)
Mock Test 5 (https://rank.sanfoundry.com/python-programming-mock-test-5/)
Mock Test 6 (https://rank.sanfoundry.com/python-programming-mock-test-6/)
Mock Test 7 (https://rank.sanfoundry.com/python-programming-mock-test-7/)
Mock Test 8 (https://rank.sanfoundry.com/python-programming-mock-test-8/)
Mock Test 9 (https://rank.sanfoundry.com/python-programming-mock-test-9/)
Mock Test 10 (https://rank.sanfoundry.com/python-programming-mock-test-10/)

« Prev Page (https://www.sanfoundry.com/python-questions-answers-list-comprehension/)


Next Page (https://www.sanfoundry.com/python-questions-answers-list-comprehension-2/) »

Python Questions and Answers – List Comprehension – 1

This set of Python Multiple Choice Questions & Answers (MCQs) focuses on “List Comprehension – 1”.

1. What is the output of the code shown?

advertisement

l=[1,2,3,4,5]
[x&1 for x in l]

a) [1, 1, 1, 1, 1]
b) [1, 0, 1, 0, 1]
c) [1, 0, 0, 0, 0]
d) [0, 1, 0, 1, 0]
View Answer
https://www.sanfoundry.com/python-questions-answers-list-comprehension-1/ 5/15
Answer:
3/27/2019 b List Comprehension Interview Questions and Answers - Sanfoundry

Explanation: In the code shown above, each of the numbers of the list, that is, 1, 2, 3, 4 and 5 are AND-ed with 1 and the result is printed in the form of
a list. Hence the output is [1, 0, 1, 0, 1].

2. What is the output of the code shown below?

l1=[1,2,3]
l2=[4,5,6]
[x*y for x in l1 for y in l2]

a) [4, 8, 12, 5, 10, 15, 6, 12, 18]


b) [4, 10, 18]
c) [4, 5, 6, 8, 10, 12, 12, 15, 18]
d) [18, 12, 6, 15, 10, 5, 12, 8, 4]
View Answer

Answer: c
Explanation: The code shown above returns x*y, where x belongs to the list l1 and y belongs to the list l2. Therefore, the output is: [4, 5, 6, 8, 10, 12, 12,
15, 18].

3. Write the list comprehension to pick out only negative integers from a given list ‘l’.
a) [x<0 in l]
b) [x for x<0 in l]
c) [x in l for x<0]
d) [x for x in l if x<0]
View Answer

Answer: d
Explanation: To pick out only the negative numbers from a given list ‘l’, the correct list comprehension statement would be: [x for x in l if x<0].

For example if we have a list l=[-65, 2, 7, -99, -4, 3]


>>> [x for x in l if x<0]
The output would be: [-65, -99, -4]

4. What is the output of the code shown?

https://www.sanfoundry.com/python-questions-answers-list-comprehension-1/ 6/15
3/27/2019 List Comprehension Interview Questions and Answers - Sanfoundry
s=["pune", "mumbai", "delhi"]
[(w.upper(), len(w)) for w in s]

a) Error
b) [‘PUNE’, 4, ‘MUMBAI’, 6, ‘DELHI’, 5]
c) [PUNE, 4, MUMBAI, 6, DELHI, 5]
d) [(‘PUNE’, 4), (‘MUMBAI’, 6), (‘DELHI’, 5)]
View Answer

Answer: d
Explanation: If we need to generate two results, we need to put it in the form of a tuple. The code shown above returns each word of list in uppercase,
along with the length of the word. Hence the output of the code is: [(‘PUNE’, 4), (‘MUMBAI’, 6), (‘DELHI’, 5)].

advertisement

5. What is the output of the code shown below?

l1=[2,4,6]
l2=[-2,-4,-6]
for i in zip(l1, l2):
print(i)

a) 2, -2
4, -4
6, -6
b) [(2, -2), (4, -4), (6, -6)]
c) (2, -2)
(4, -4)
(6, -6)
d) [-4, -16, -36]
View Answer

Answer: c
Explanation: The output of the code shown will be:
(2, -2)
(4, -4)
https://www.sanfoundry.com/python-questions-answers-list-comprehension-1/ 7/15
(6, -6)
3/27/2019 List Comprehension Interview Questions and Answers - Sanfoundry

This format is due to the statement print(i).

6. What is the output of the following code?

l1=[10, 20, 30]


l2=[-10, -20, -30]
l3=[x+y for x, y in zip(l1, l2)]
l3

a) Error
b) 0
c) [-20, -60, -80]
d) [0, 0, 0]
View Answer

Answer: d
Explanation: The code shown above returns x+y, for x belonging to the list l1 and y belonging to the list l2. That is, l3=[10-10, 20-20, 30-20], which is, [0,
0, 0]

7. Write a list comprehension for number and its cube for l=[1, 2, 3, 4, 5, 6, 7, 8, 9].
a) [x**3 for x in l]
b) [x^3 for x in l]
c) [x**3 in l]
d) [x^3 in l]
View Answer

Answer: a
Explanation: The list comprehension to print a list of cube of the numbers for the given list is: [x**3 for x in l].

advertisement

https://www.sanfoundry.com/python-questions-answers-list-comprehension-1/ 8/15
3/27/2019 List Comprehension Interview Questions and Answers - Sanfoundry

8. What is the output of the code shown below?

l=[[1 ,2, 3], [4, 5, 6], [7, 8, 9]]


[[row[i] for row in l] for i in range(3)]

a) Error
b) [[1, 4, 7], [2, 5, 8], [3, 6, 9]]
c) 1 4 7
258
369
d) (1 4 7)
(2 5 8)
(3 6 9)
View Answer

Answer: b
Explanation: In the code shown above, ‘3’ is the index of the list. Had we used a number greater than 3, it would result in an error. The output of this
code is: [[1, 4, 7], [2, 5, 8], [3, 6, 9]].

9. What is the output of the code shown below?

import math
[str(round(math.pi)) for i in range (1, 6)]

a) [‘3’, ‘3’, ‘3’, ‘3’, ‘3’, ‘3’]


b) [‘3.1’, ‘3.14’, ‘3.142’, ‘3.1416’, ‘3.14159’, ‘3.141582’]
c) [‘3’, ‘3’, ‘3’, ‘3’, ‘3’]
d) [‘3.1’, ‘3.14’, ‘3.142’, ‘3.1416’, ‘3.14159’]
View Answer
https://www.sanfoundry.com/python-questions-answers-list-comprehension-1/ 9/15
Answer:
3/27/2019 c List Comprehension Interview Questions and Answers - Sanfoundry

Explanation: The list comprehension shown above rounds off pi(3.141) and returns its value, that is 3. This is done 5 times. Hence the output is: [‘3’, ‘3’,
‘3’, ‘3’, ‘3’].

10. What is the output of the code shown below?

l1=[1,2,3]
l2=[4,5,6]
l3=[7,8,9]
for x, y, z in zip(l1, l2, l3):
print(x, y, z)

a) 1 4 7
258
369
b) (1 4 7)
(2 5 8)
(3 6 9)
c) [(1, 4, 7), (2, 5, 8), (3, 6, 9)]
d) Error
View Answer

Answer: a
Explanation: The output of the code shown above is:
147
258
369
This is due to the statement: print(x, y,z).

Sanfoundry Global Education & Learning Series – Python.

To practice all areas of Python, here is complete set of 1000+ Multiple Choice Questions and Answers (https://www.sanfoundry.com/1000-python-
questions-answers/).

« Prev Page - Python Questions and Answers – List Comprehension (https://www.sanfoundry.com/python-questions-answers-list-comprehension/)


» Next Page - Python Questions and Answers – List Comprehension – 2 (https://www.sanfoundry.com/python-questions-answers-list-comprehension-2/)

https://www.sanfoundry.com/python-questions-answers-list-comprehension-1/ 10/15
3/27/2019 advertisement
List Comprehension Interview Questions and Answers - Sanfoundry

Deep Dive @ Sanfoundry:


1. C Programming Examples using Recursion (https://www.sanfoundry.com/c-programming-examples-recursion/)
2. Simple Java Programs (https://www.sanfoundry.com/simple-java-programs/)
3. Simple C Programs (https://www.sanfoundry.com/simple-c-programs/)
4. C Programming Examples on Bitwise Operations (https://www.sanfoundry.com/c-programming-examples-bitwise-operations/)
5. Python Programming Examples (https://www.sanfoundry.com/python-problems-solutions/)
6. C Programming Examples on Linked List (https://www.sanfoundry.com/c-programming-examples-linked-list/)
7. Python Questions and Answers (https://www.sanfoundry.com/1000-python-questions-answers/)
8. Python Program to Create a Linked List & Display the Elements in the List (https://www.sanfoundry.com/python-program-create-linked-
list-display-elements-list/)
9. Python Program to Convert a given Singly Linked List to a Circular List (https://www.sanfoundry.com/python-program-convert-given-
singly-linked-list-circular-list/)
10. Python program to Sort a List of Tuples in Increasing Order by the Last Element in Each Tuple (https://www.sanfoundry.com/python-
program-sort-list-tuples-increasing-order-last-element-tuple/)

Do You Know Your Strange




Tech Tidbits?
Bill Gates has a favorite tree at home
that he has monitored electronically 24

0/10
hours to make sure it’s never dry

SCORE
TRUE   FALSE

Sponsored

https://www.sanfoundry.com/python-questions-answers-list-comprehension-1/ 11/15
3/27/2019 List Comprehension Interview Questions and Answers - Sanfoundry

Manish Bhojasia (https://in.linkedin.com/in/manishbhojasia?trk=profile-badge) Manish Bhojasia (https://www.sanfoundry.com/about/), a technology


veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer & SAN Architect and is passionate about
competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux
Debugging, Linux Device Drivers, Linux Networking, Linux Storage, Advanced C Programming, SAN Storage Technologies, SCSI Internals & Storage
Protocols such as iSCSI & Fiber Channel. Stay connected with him @ LinkedIn (https://www.linkedin.com/in/manishbhojasia) | Facebook
(https://www.facebook.com/sanfoundry) | Twitter (https://www.twitter.com/sanfoundry)

Best Careers

Developer Tracks (https://www.sanfoundry.com/salary-50l/)


SAN Developer (https://www.sanfoundry.com/san-storage-developer-training-courses/)
Linux Kernel Developer (https://www.sanfoundry.com/linux-kernel-developer-training-courses-jobs/)
Linux Driver Developer (https://www.sanfoundry.com/linux-device-driver-developer-training/)
Linux Network Developer (https://www.sanfoundry.com/linux-network-developer-training/)

Live Training Photos (https://www.sanfoundry.com/sanfoundry-classes/)


Mentoring (https://www.sanfoundry.com/professional-mentoring-coaching-career-guidance-cto/)
Software Productivity (https://www.sanfoundry.com/programming-discipline-and-software/)
GDB Assignment (https://www.sanfoundry.com/gdb-example-tutorial/)

Sanfoundry is No. 1 choice for Deep Hands-ON Trainings in SAN, Linux & C, Kernel Programming. Our Founder has trained employees of almost all
Top Companies in India such as VMware, Citrix, Oracle, Motorola, Ericsson, Aricent, HP, Intuit, Microsoft, Cisco, SAP Labs, Siemens, Symantec,

https://www.sanfoundry.com/python-questions-answers-list-comprehension-1/ 12/15
Redhat,
3/27/2019 Chelsio, Cavium, ST-Micro, Samsung, LG-Soft,
List Wipro, TCS,Interview
Comprehension HCL, Questions
IBM, Accenture,
and Answers HSBC, Mphasis, Tata-Elxsi, Tata VSNL, Mindtree,
- Sanfoundry

Cognizant and Startups.

Best Trainings

SAN I - Technology (https://www.sanfoundry.com/san-storage-area-networks-training/)


SAN II - Admin (https://www.sanfoundry.com/san-administration-training-course/)
Linux Fundamentals (https://www.sanfoundry.com/linux-administration-training/)
Advanced C Training (https://www.sanfoundry.com/advanced-c-programming-training/)
Linux-C Debugging (https://www.sanfoundry.com/training-on-linux-debugging-techniques/)
System Programming (https://www.sanfoundry.com/training-on-linux-internals-systems/)
Network Programming (https://www.sanfoundry.com/training-socket-network-programming/)
Linux Threads (https://www.sanfoundry.com/training-multithreaded-parallel/)
Kernel Programming (https://www.sanfoundry.com/linux-kernel-internals-training/)
Kernel Debugging (https://www.sanfoundry.com/linux-kernel-debugging-training/)
Linux Device Drivers (https://www.sanfoundry.com/training-on-linux-device-drivers/)

https://www.sanfoundry.com/python-questions-answers-list-comprehension-1/ 13/15
3/27/2019 List Comprehension Interview Questions and Answers - Sanfoundry

Best Reference Books

Computer Science Books (https://www.sanfoundry.com/best-reference-books-computer-science-engineering/)


Algorithm & Programming Books (https://www.sanfoundry.com/best-reference-books-programming-hot-technologies)
Electronics Engineering Books (https://www.sanfoundry.com/best-reference-books-electrical-electronics-engineering/)
Electrical Engineering Books (https://www.sanfoundry.com/best-reference-books-electrical-electronics-engineering/)
Chemical Engineering Books (https://www.sanfoundry.com/best-reference-books-chemical-engineering/)
Civil Engineering Books (https://www.sanfoundry.com/best-reference-books-civil-engineering/)
Mechanical Engineering Books (https://www.sanfoundry.com/best-reference-books-mechanical-engineering/)
Industrial Engineering Books (https://www.sanfoundry.com/best-reference-books-industrial-engineering-operations-research/)
Instrumentation Engg Books (https://www.sanfoundry.com/best-reference-books-instrumentation-engineering/)
Metallurgical Engineering Books (https://www.sanfoundry.com/best-reference-books-metallurgical-engineering/)
All Stream Best Books (https://www.sanfoundry.com/best-reference-books-tech-engineering-sciences/)

Questions and Answers

1000 C Questions & Answers (https://www.sanfoundry.com/c-interview-questions-answers/)


1000 C++ Questions & Answers (https://www.sanfoundry.com/cplusplus-interview-questions-answers/)
1000 C# Questions & Answers (https://www.sanfoundry.com/1000-csharp-questions-answers/)
1000 Java Questions & Answers (https://www.sanfoundry.com/java-questions-answers-freshers-experienced/)
1000 Linux Questions & Answers (https://www.sanfoundry.com/technical-interview-questions/)
1000 Python Questions (https://www.sanfoundry.com/1000-python-questions-answers/)
1000 PHP Questions & Answers (https://www.sanfoundry.com/1000-php-questions-answers/)
1000 Hadoop Questions (https://www.sanfoundry.com/1000-hadoop-questions-answers/)
Cloud Computing Questions (https://www.sanfoundry.com/1000-cloud-computing-questions-answers/)
Computer Science Questions (https://www.sanfoundry.com/computer-science-questions-answers/)
All Stream Questions & Answers (https://www.sanfoundry.com/)

India Internships

https://www.sanfoundry.com/python-questions-answers-list-comprehension-1/ 14/15
Computer
3/27/2019 Science Internships (https://www.sanfoundry.com/internships-computer-science-engineering/)
List Comprehension Interview Questions and Answers - Sanfoundry

Instrumentation Internships (https://www.sanfoundry.com/internships-instrumentation-engineering/)


Electronics Internships (https://www.sanfoundry.com/internships-electronics-electrical-engineering/)
Electrical Internships (https://www.sanfoundry.com/internships-electronics-electrical-engineering/)
Mechanical Internships (https://www.sanfoundry.com/internships-mechanical-engineering/)
Industrial Internships (https://www.sanfoundry.com/internship-industrial-engineering/)
Systems Internships (https://www.sanfoundry.com/internships-systems-control-engineering/)
Chemical Internships (https://www.sanfoundry.com/internships-chemical-engineering/)
Civil Internships (https://www.sanfoundry.com/internships-civil-engineering/)
IT Internships (https://www.sanfoundry.com/internship/)
All Stream Internships (https://www.sanfoundry.com/internship/)

About Sanfoundry

About Us (https://www.sanfoundry.com/about/)
Copyright (https://www.sanfoundry.com/copyright/)
Terms (https://www.sanfoundry.com/tos-privacy-policy/)
Privacy Policy (https://www.sanfoundry.com/privacy-policy/)
Jobs (https://www.sanfoundry.com/jobs/)
Bangalore Training (https://www.sanfoundry.com/coursesfees/)
Online Training (https://www.sanfoundry.com/online-training-san-linux-kernel-device-drivers/)
Developers Track (https://www.sanfoundry.com/salary-50l/)
Mentoring Sessions (https://www.sanfoundry.com/professional-mentoring-coaching-career-guidance-cto/)
Contact Us (https://www.sanfoundry.com/contact/)
Sitemap (https://www.sanfoundry.com/sitemap_index.xml)

© 2011-2019 Sanfoundry. All Rights Reserved.

https://www.sanfoundry.com/python-questions-answers-list-comprehension-1/ 15/15

You might also like