We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dee6dce commit a555c11Copy full SHA for a555c11
Core_Python/python core.py
@@ -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