-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimporting_modules.py
More file actions
52 lines (38 loc) · 1022 Bytes
/
importing_modules.py
File metadata and controls
52 lines (38 loc) · 1022 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
47
48
49
50
51
""""
This module practice working with importing mudules.
"""
# import my_module
# import my_module as mm
from my_module import find_index, test
# Some python standard libraries
import os
import sys
import random
import math
import datetime
import calendar
courses = ["Math", "Art", "CompSci", "Science", "History"]
# index = my_module.find_index(courses, "CompSci")
# index = mm.find_index(courses, "CompSci")
index = find_index(courses, "CompSci")
print(index)
print(test)
# Get a random item from a list
random_course = random.choice(courses)
print(random_course)
# Calculate sin of 90 degree
rads = math.radians(90)
sinus = math.sin(rads)
print(sinus)
# Get date of today
print(datetime.date.today())
# Leap year
print(calendar.isleap(2024))
# Show current directory
print(os.getcwd())
# Show the directory that library is there
print(os.__file__)
# Show all paths to search for modules
# print(sys.path)
# Add a path of my_modules is in my Desktop
# sys.path.append("C://Users/Hamid/Destop/my_modules")