In [4]:
x=29.0
y=13
z=2
p=0.5
q=12.79
i=13
j=29.0
k=y-11
In [5]:
x/y
Out[5]:
In [6]:
x//4
Out[6]:
In [7]:
y-i+p
Out[7]:
In [8]:
y**z
Out[8]:
In [9]:
y%z
Out[9]:
In [10]:
x/j
Out[10]:
In [11]:
q%p
Out[11]:
In [12]:
y+z%4
Out[12]:
In [13]:
(y+z)%4
Out[13]:
In [14]:
y+(z%4)
Out[14]:
In [15]:
y*x/z
Out[15]:
In [17]:
r=p+z-x/y*y**z//x%(p+z)
r
Out[17]:
In [18]:
4**3**z
Out[18]:
In [19]:
2**2**3
Out[19]:
In [20]:
4**3
Out[20]:
In [21]:
2**2
Out[21]:
In [22]:
2**8
Out[22]:
In [1]:
x=29.0
y=13
z=2
p=0.5
q=12.79
i=13
j=29.0
k=y-11
In [2]:
a=''
b=''
c='great'
d='Great'
e='GREAT'
f='Great'
g='GREAT'
h='great'
In [3]:
y>p*26
Out[3]:
In [4]:
y==p*26
Out[4]:
In [5]:
print(y,p*26)
In [6]:
(y>p)*26
Out[6]:
In [7]:
(y<p)*26
Out[7]:
In [8]:
True*26
Out[8]:
In [9]:
False*26
Out[9]:
In [10]:
x<=y<x+y
Out[10]:
In [11]:
y<=x+y
Out[11]:
In [12]:
x<=True
Out[12]:
In [13]:
x<=y and y<x+y
Out[13]:
In [14]:
x//y
Out[14]:
In [15]:
x//y<p*20
Out[15]:
In [16]:
p*20
Out[16]:
In [17]:
x!=y*z+3
Out[17]:
In [18]:
x
Out[18]:
In [19]:
y*z+3
Out[19]:
In [20]:
x==y*z+3
Out[20]:
In [21]:
x-3!=y*2
Out[21]:
In [22]:
x-3==y*2
Out[22]:
In [23]:
x-3
Out[23]:
In [24]:
y*2
Out[24]:
In [25]:
x-(3!=y)*2
Out[25]:
In [26]:
3!=y
Out[26]:
In [27]:
x-True*2
Out[27]:
In [28]:
a==b
Out[28]:
In [29]:
c==d
Out[29]:
In [30]:
d==g
Out[30]:
In [31]:
f==d
Out[31]:
In [32]:
e==g
Out[32]:
In [33]:
h==c
Out[33]:
In [34]:
#again practice more
x=29.0
y=13
z=2
p=0.5
q=12.79
i=13
j=29.0
k=y-11
a=''
b=''
c='great'
d='Great'
e='GREAT'
f='Great'
g='GREAT'
h='great'
In [35]:
y==13
Out[35]:
In [36]:
y==i
Out[36]:
In [37]:
l=3+4.5j
In [38]:
l
Out[38]:
In [40]:
m=(3+4.5j)
In [41]:
m
Out[41]:
In [42]:
y is i
Out[42]:
In [43]:
y==i
Out[43]:
In [44]:
g==e
Out[44]:
In [45]:
e is not g
Out[45]:
In [46]:
k==z
Out[46]:
In [47]:
z is not k
Out[47]:
In [48]:
l==m
Out[48]:
In [49]:
l is m
Out[49]:
In [50]:
z is k
Out[50]:
In [51]:
#Logical Operator Practice
x=29.0
y=13
z=2
p=0.5
q=12.79
i=13
j=29.0
k=y-11
a=''
b=''
c='great'
d='Great'
e='GREAT'
f='Great'
g='GREAT'
h='great'
In [52]:
l=3+4.5j
m=3+4.5j
In [53]:
x>y and y>z
Out[53]:
In [54]:
x>y or y>z
Out[54]:
In [55]:
x<y or y>z
Out[55]:
In [56]:
not x>y
Out[56]:
In [57]:
not x>y or y>z
Out[57]:
In [58]:
x>y
Out[58]:
In [59]:
not x>y
Out[59]:
In [60]:
y>z
Out[60]:
In [61]:
not(x>y or y>z)
Out[61]:
In [62]:
x-y*2>y*2
Out[62]:
In [63]:
x-y*2>y*2 or y*p>y
Out[63]:
In [64]:
x-y*2>y*2 and y*p>y
Out[64]:
In [65]:
x-y*2
Out[65]:
In [66]:
y*2
Out[66]:
In [67]:
x>y>z
Out[67]:
In [68]:
i<j<k
Out[68]:
In [69]:
y&z
Out[69]:
In [70]:
y|z
Out[70]:
In [71]:
~y
Out[71]:
In [ ]:
No comments:
Post a Comment