Skip to content

Commit a555c11

Browse files
authored
Add files via upload
1 parent dee6dce commit a555c11

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

Core_Python/python core.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# in this code contains
2+
#format
3+
#date and time
4+
5+
6+
# format in python
7+
8+
op = "Hello, {0} {1}".format("Rohan", "kumara")
9+
print(op)
10+
print(f'Hello, {"Rohan"} {"Kumara"}')
11+
print(f'Fuck off python {"Rohan"}')
12+
13+
# date
14+
from datetime import datetime
15+
16+
#current date & time
17+
today = datetime.now()
18+
# this functions return a datetime object
19+
print(f'Today is: {str(today)}')
20+
21+
# timedelta is used to define a period of time
22+
from datetime import timedelta
23+
24+
one_day = timedelta(days=1)
25+
yesterday = today - one_day
26+
print(f'Yesterday was: {str(yesterday)}')
27+
28+
# print date month year separetly

0 commit comments

Comments
 (0)