-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path001__example.py
More file actions
46 lines (35 loc) · 917 Bytes
/
001__example.py
File metadata and controls
46 lines (35 loc) · 917 Bytes
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
def get_users() -> dict[int, str]:
"""
This function returns a dictionary of users
consist of user_id as key and user_name as value.
Args:
None
Returns:
dict[int, str]: A dictionary of users.
"""
users: dict[int, str] = {
1: "Rezaul",
2: "Karim",
3: "Shaon",
}
return users
def display_users(users: dict[int, str]) -> None:
"""
This function displays the users in the dictionary.
Args:
users: dict[int, str]: A dictionary of users.
Returns:
None
"""
for user_id, user_name in users.items():
print(f"{user_id}: {user_name}")
def main() -> None:
"""
This is the main function of the program.
It calls the get_users()
and display_users() functions.
"""
users: dict[int, str] = get_users()
display_users(users)
if __name__ == "__main__":
main()