a=3;
b=4;
print(a+1, a-1);
print(b*3, b/2);
print(a%2, b**2);
print(2+4.0, 2.0**b);
print(b/2 + a);
print(b/(2.0+a));
num=1/3.0;
print(num);
print('%e' % num);
print('%4.2f' % num);
print('{0:4.2f}'.format(num));
print(1<2);
print(2.0>=1);
num=1/3.0;
print(str(num));
print(repr(num));
print(2.0==2.0);
print(2.0!=2.0);
print(2.0==2);
x=2;
y=4;
z=6;
print(x<y<z);
print(x<y and y<z);
print(x<y>z);
print(x<y and y>z);
print(10/4);
print(10//4);
print(10/4.0);
print(10//4.0);
import math;
print(math.floor(2.5));
print(math.floor(-2.5));
print(math.trunc(2.5));
print(math.trunc(-2.5));
print('***********');
print(5/2, 5/-2);
print(5//2, 5//-2);
print(5/2.0, 5/-2.0);
print(5//2.0, 5//-2.0);
print('***********');
print(0o1, 0o20, 0o377);
print(0x01, 0x10, 0xff);
print(0b1, 0b10000, 0b11111111);
print('**********');
print(oct(255), hex(255), bin(255));
x=0xffffffffffffffffffffffff;
print(oct(x));
print(hex(x));
print(bin(x));
x=0b0001;
print(x<<2);
print(bin(x<<2));
print(bin(x|0b010));
x=0xff;
print(bin(x));
print(x^0b10101010);
print(bin(x^0b10101010));
print(int('1010101', 2));
print(hex(85));
x=99;
print(bin(x), x.bit_length());
print(len(bin(x)));
print(math.pi, math.e);
print(math.sin(2*math.pi/180));
print(math.sqrt(144), math.sqrt(2));
print(pow(2,4), 2**4);
print(abs(-42.0), sum((1,2,3,4)));
print(min(3,1,2,4), max(3,1,2,4));
print('********');
print(round(3.1));
print('%.1f' %2.567, '{0:.2f}'.format(2.567));
print('*********');
print(math.sqrt(144), 144**.5, pow(144,.5));
import random;
print('********');
print(random.random());
print(random.randint(1,10));
print(random.randint(1,10));
print(random.choice(['Life of Brain', 'Holy Grail', 'Meaning of Life']));
print('********');
import decimal;
decimal.getcontext().prec=4;
print(decimal.Decimal(1)/decimal.Decimal(8));
print('********');
with decimal.localcontext() as ctx:
	ctx.prec=2;
	print(decimal.Decimal('1.00')/decimal.Decimal('3.00'));

print(decimal.Decimal('1.00')/decimal.Decimal('3.00'));
print('********fraction*********');
from fractions import Fraction;
x=Fraction(1,3);
y=Fraction(4,6);
print(x);
print(y);
print(x+y);
print(x-y);
print(x*y);
print(Fraction('.25'));
print(Fraction('1.25'));
print((2.5).as_integer_ratio());
f=2.5;
z=Fraction(*f.as_integer_ratio());
print(z);
print(float(z));
a=Fraction(225, 135);
print(a.limit_denominator(10));
print('*********set***********');
x=set('abcde');
y=set('bdxyz');
print(x, y);
print(x-y);
print(x|y);
print(x&y);
print(x^y);
print(x>y, x<y);
z=x.intersection(y);
print(z);
z.add('SPAM');
print(z);
z.update(set(['x', 'Y']));
print(z);
z.remove('b');
print(z);
for item in set('abc'): 
	print(item*3);

s={'s', 'p', 'a', 'm'};
s.add('alot');
print(s);
print({x**2 for x in [1, 2, 3, 5, 6]});
print({x for x in 'spam'});
print({c*4 for c in 'spam'});
S={c*4 for c in 'spam'};
print(S|{'mmm', 'xxxx'});
print('**************set usage*************');
L=[1,2,3,1,2,3,6];
print('L is', L);
print(list(set(L)));
engineers={'bob', 'sue', 'ann', 'vic'};
managers={'tom', 'sue'};
print('bob' in engineers);
print(engineers & managers);
print(engineers | managers);
print(engineers-managers);
print(managers-engineers);
print(engineers>managers);
print(engineers^managers);
print('****************bool*************');
print(type(True));
print(isinstance(True, int));
print(True ==1);
print(True is 1);
print(True or False);
print(True + 4);
