This repository was archived by the owner on Oct 16, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.py
More file actions
54 lines (42 loc) · 1.16 KB
/
start.py
File metadata and controls
54 lines (42 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#import predefined module time
import time
#import user defined modules
from sum.sum import *
from diff.diff import diff
from user.user import User
print(sum(10, 20))
user1 = User("XYZ",1008)
user1.show_user()
#lists
list1 = [1,"XYZ",10.4, True]
print(f'List : {list1}')
print(f'List element at index 1 : {list1[1]}')
print(f"List tuple ':' : {list1[:]}")
print(f"List from index 1 till end : {list1[1:]}")
print(f'List from 1 to 3: {list1[1:3]}')
for i in list1:
print(f'List values: {i}')
for i in range(len(list1)):
print(f'List values: {list1[i]}')
#Tuple
tup1 = (1,"XYz",10.4, True)
print(f'Tuple : {tup1}')
#set
set1 = {1,2,3,1,4}
print(f'Tuple : {set1}')
#dictionary
dict1 = {
"fname":"XYZ",
"lname": "PQZ",
"id" :91
}
print(f'Dictionary : {dict1}')
print(f"Dictonary of key 'lname' : {dict1['lname']}")
print(f'Print Dictonary keys : {dict1.keys()}')
print(f'Print Dictionary Values : {dict1.values()}')
print(f'Print dictionary as key value pair: {dict1.items()}')
for key in dict1.keys():
print(f'Dictionary Values: {dict1[key]}')
# Checks if the file is the main execution file
if __name__ == "__main__":
print(f'__name__:{__name__}')