-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpython.rtf
executable file
·98 lines (94 loc) · 2.33 KB
/
python.rtf
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf540
{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\froman\fcharset0 Times-Roman;}
{\colortbl;\red255\green255\blue255;\red51\green51\blue51;}
{\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{none\}.}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid1}}
{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}}
\paperw11900\paperh16840\margl1440\margr1440\vieww9560\viewh10280\viewkind0
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural
\f0\fs24 \cf0 number**othernumber\
- number^othernumber --> exponent (2^3 = 2**3 = 8)\
\
number % other\
- remainder (e.g. 108 % 100 = 8)\
\
print(_variable_)\
\
\
print '%s hello' %(_variable_)\
=%s substituted by variable\
\
len( _variable_)\
= length of the word\
\
_variable_.lower()\
= gets rid of all the capitalized letters\
\
_variable_.upper()\
= capitalizes everything\
\
//in both cases the dots are used as they only work for strings\
\
str(_variable_)\
= turn non-strings into strings\
\
datetime \
= keep track of something\
\
\
from datetime import datetime\
=imports datetime library\
\
\
datetime.now()\
=retrieve current date and time\
\
now.year\
now.month\
now.day\
now.hour\
now,minute\
now.second\
=only retrieves those \
\
//now - variable in which datetime.now() stored\
\
\
\b Comparators:\
\b0 1. Equal to ==\
2. Not equal to !=\
3. Less than <\
4. Less than or equal to <=\
5. More than >\
6. More than or equal to >=\
\
\
\b Boolean operators
\b0 :\
and - checks if both the statements are true\
or - which checks if at least one statement is true\
not - gives the opposite of the statement\
\
True and False is False\
False and True is False\
False and False is False\
\
True or True is True\
True or False is True\
False or True is True\
False or False is False\
\
Not True is False\
Not False is True\
\
\pard\tx220\tx720\pardeftab720\li720\fi-720\sl400\sa180\ql\qnatural
\ls1\ilvl0
\f1\fs30 \cf2 not is evaluated first;\
and is evaluated next;\
or is evaluated last.
\f0\fs24 \cf0 \
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural
\cf0 \
\
\
\
}