Skip to content

Commit 131f991

Browse files
committed
update
1 parent b547816 commit 131f991

File tree

4 files changed

+48
-1
lines changed

4 files changed

+48
-1
lines changed

Dictionary/dictionary.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# Dictionary
1+
# Dictionary :
2+
# Dictionaries are used to store data values in key:value pairs.
3+
# A dictionary is a collection which is ordered*, changeable and do not allow duplicates.
4+
# As of Python version 3.7, dictionaries are ordered. In Python 3.6 and earlier, dictionaries are unordered.
5+
# Dictionaries are written with curly brackets, and have keys and values:
26

37
thisDict = {
48
"name" : "Grande",

List/list.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# List :
2+
# Lists are used to store multiple items in a single variable.
3+
# Lists are one of 4 built-in data types in Python used to store collections of data, the other 3 are Tuple, Set, and Dictionary, all with different qualities and usage.
4+
# Lists are created using square brackets:
5+
16
myList = ["App Developer","Python Developer","Website Developer","Ai Developer"]
27
print(myList)
38

Tuples/tuple.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Tuples:
2+
# Tuples are used to store multiple items in a single variable.
3+
# Tuple is one of 4 built-in data types in Python used to store collections of data, the other 3 are List, Set, and Dictionary, all with different qualities and usage.
4+
# A tuple is a collection which is ordered and unchangeable.
5+
# Tuples are written with round brackets.
6+
7+
myTuple = ("Red","Green","Blue")
8+
print(myTuple)
9+
print(type(myTuple))
10+
print(len(myTuple))
11+
12+
# Access
13+
14+
print(myTuple[0])
15+
print(myTuple[-1])
16+
print(myTuple[1:])
17+
18+
myTuple2 = ("Orange","Yellow")
19+
20+
# Join
21+
22+
allTuple = myTuple + myTuple2
23+
print(allTuple)
24+
25+
for x in myTuple:
26+
print(x)
27+
28+
if "Red" in myTuple:
29+
print("Red AVailble")
30+
31+
# Coun
32+
33+
print(myTuple2.count("Orange"))

Variables/variable.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1+
# Varibale :
12
# What Are Variables And How Variables Are Decalred And Initialized In Python
3+
# Variables are containers for storing data values.
4+
5+
# Python has no command for declaring a variable.
6+
# A variable is created the moment you first assign a value to it.
27

38
name = "Maaz Khan";
49
print(name);

0 commit comments

Comments
 (0)