Skip to content

Commit f76f9ca

Browse files
committed
Update
1 parent fb1d8bd commit f76f9ca

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

4_Dictionary/8_IntroToDictionary.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,42 @@
5959

6060
y = tuple1.index(7) # this will print the first index of "7" in the tuple
6161
print("Index of '7' in tuple is: ", y)
62+
63+
###########------------------BONUS------------------###########
64+
65+
print("\n")
66+
print('''
67+
You can find the methods attached to "List", "Tuples", "Dictionary", "Strings", "Integers","Floats"
68+
using "dir" function.
69+
''')
70+
71+
a_integer = 6
72+
a_float = 3.67
73+
a_string = "Maharashtra-INDIA"
74+
a_list = [1, 2, 3, 5, 7, 3, "hello", "sayonara", 3.1415]
75+
a_tuple = (1, 2, 3, 5, 7, 3, "hello", "sayonara", 3.1415)
76+
a_dictionary = {"Virat": 98, "Sachin": 101, "Dhoni": 96, "Rahul": "56 not out" }
77+
78+
print("\n")
79+
print("a_integer: ",a_integer)
80+
print(dir(a_integer))
81+
82+
print("\n")
83+
print("a_float: ", a_float)
84+
print(dir(a_float))
85+
86+
print("\n")
87+
print("a_string: ",a_string)
88+
print(dir(a_string))
89+
90+
print("\n")
91+
print("a_list: ", a_list)
92+
print(dir(a_list))
93+
94+
print("\n")
95+
print("a_tuple: ", a_tuple)
96+
print(dir(a_tuple))
97+
98+
print("\n")
99+
print("a_dictionary: ",a_dictionary)
100+
print(dir(a_dictionary))

0 commit comments

Comments
 (0)