DWDM
DWDM
LAB WEEK – 1
INPUT:
OUTPUT:
2. Write a code to extract each digit from an integer, in the
reverseOrder.
Expected Output: For example, if the given int is 7536, the
output shall be “6 3 5 7“, with a space separating the digits.
INPUT:
OUTPUT:
3. Given a list iterate it and display numbers which are
divisible by 5 and if you find number greater than 150
stop the loop iteration list1 = [12, 15, 32, 42, 55, 75, 122,
132, 150, 180, 200]
Enter the number of elements in the list:11
enter the 0th element 12
enter the 1th element 15
enter the 2th element 32
enter the 3th element 42
enter the 4th element 55
enter the 5th element 75
enter the 6th element 122
enter the 7th element 132
enter the 8th element 150
enter the 9th element 180
enter the 10th element 200
The elements are: 15 55 75 150
INPUT:
OUTPUT:
4. Count all lower case, upper case, digits, and special symbols
from a given string.
Given: str1 = "P@#yn26at^&i5ve"
Expected Outcome: Total counts of chars, digits, and symbols
Chars = 8
Digits = 3
Symbol = 4
INPUT:
OUTPUT:
INPUT:
OUTPUT:
INPUT :
OUTPUT:
7. Given a two list of equal size create a set such that it shows the
element from both lists in the pair.
Expected Output:
First List [2, 3, 4, 5, 6, 7, 8]
Second List [4, 9, 16, 25, 36, 49, 64]
Result is {(6, 36), (8, 64), (4, 16), (5, 25), (3, 9), (7,49),(2,4)}
INPUT :
OUTPUT:
8. Given a dictionary get all values from the dictionary and add it
in a list but don’t add duplicates.
speed ={'jan':47, 'feb':52, 'march':47, 'April':44, 'May':52,
'June':53, 'july':54, 'Aug':44, 'Sept':54}
Expected Outcome: [47, 52, 44, 53, 54]
INPUT :
OUTPUT :
INPUT :
OUTPUT: