-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathassignment8.py
More file actions
43 lines (20 loc) · 721 Bytes
/
Copy pathassignment8.py
File metadata and controls
43 lines (20 loc) · 721 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
# QUESTION 2
import time
import math
import os
print('Formatted Time: ', time.asctime())
# QUESTION 3
print('Month: ', time.gmtime().tm_mon)
# QUESTION 4
print('Day: ', time.gmtime().tm_mday)
# QUESTION 5
print('Date: ', time.gmtime().tm_mday)
# QUESTION 6
print('Time: ', time.localtime().tm_hour, ':', time.localtime().tm_min, ':', time.localtime().tm_sec)
# QUESTION 7
print('Factorial: ', math.factorial(int(input('Enter a number: '))))
# QUESTION 8
print('GCD: ', math.gcd(int(input('Enter 1st number: ')), int(input('Enter 2nd number: '))))
# QUESTION 9
print('My current working directory: ', os.getcwd())
print('Environment: ', os.environ())