dev-resources.site
for different kinds of informations.
Python List Tutorial
Published at
1/6/2025
Categories
python
list
payilagam
Author
poornima_ravi
Author
13 person written this
poornima_ravi
open
#Problem 1: Print the following Output from the 2 given lists.
#10 5 10 7
#20 5 20 10 20 30
#30 5 30 10
l1 = [10,20,30]
l2 = [5,10,30]
for value in l1:
for elem in l2:
if value != elem:
print(value, elem, end=' ')
print()
#Problem 2 : Missing Values
print('===================================================')
l1 = [10,20,30,40,50,70,80,100,120,130,170]
d = l1[1] - l1[0]
i=0
while i<(len(l1)-1):
if (l1[i+1] - l1[i]) != d :
print('Missing Value:',l1[i]+d)
i+=1
#Problem 3 : l1 = [5,0,10,3,2,7,6,5,4,9,1]
#Find pair of elements with a given sum =10
print('===================================================')
l1 = [5,0,10,3,2,7,6,5,4,9,1]
i=0
j=0
while i < len(l1):
while j < len(l1):
if l1[i]+l1[j] == 10 and j != i:
print('#Element:',i,'-',l1[i],'#Index[',j,']',l1[j])
j+=1
i+=1
j=0
payilagam Article's
30 articles in total
Python List Tutorial Day2
read article
System.out.println()
read article
Python List Tutorial
currently reading
String Functions Examples
read article
Front end day-1 (html,css)
read article
About IRC - Internet Relay Chat
read article
Python Day-29 Dictionary- Exercises, Tasks
read article
LCM & GCD of two numbers
read article
Weekend - Python Interview Questions
read article
Day14 Inheritance:
read article
Python day-28 Dictionary, Frequency of character using nested loops
read article
Objects
read article
System.out.println()
read article
Constructor
read article
Introduction
read article
Python Day-25 List functions, Tasks
read article
Day 12 Constructor in java:
read article
Day 4 - Dec 23 -->java simple program
read article
Day-5 Example for Encapsulation
read article
Day 11 Encupsulation
read article
Day 11 Today class:
read article
Day - 1 Task 1
read article
Day 10 Task:
read article
java task 3
read article
Day9 :Task2
read article
Java Constructors
read article
java task 3
read article
java 3 task
read article
java task1
read article
Python Day-23 Lists and list functions,Task
read article
Featured ones: