Probleme La Seminar1
Probleme La Seminar1
Probleme La Seminar1
a) 2/5
b) 7.9+1.1
c) 6-2
d) 8+1
e) 9+1.1
f) 2*7
g) 3.2/1.6
h) 5*8.0
i) 3.4-1.1
>>> 2/5
0.4
>>> 7.9+1.1
9.0
>>> 6-2
>>> 8+1
>>> 9+1.1
10.1
>>> 2*7
14
>>> 3.2/1.6
2.0
>>> 5*8.0
40.0
>>> 3.4-1.1
2.3
a) var =12
b) var +2
>>> var=12
>>> var+2
14
a) bool(-30)
b) bool(0.2)
c) bool(0)
d) bool(0.0)
e) bool(s)
f) bool(None)
a) >>> bool(-30)
True
b) >>> bool(0.2)
True
c) >>> bool(0)
False
d) >>> bool(0.0)
False
e) >>> bool(s)
f) >>> bool(None)
False
a) True+3
b) 3*True +False
a) >>> True+3
b) >>> 3*True+False
a) type(5.8e+3)
b) type(1+4.0+2)
c) type(None)
d) type(‘float’)
e) type(2j*4)
a) >>> type(5.8e+3)
<class 'float'>
>>> 5.8e+3
5800.0
b) >>> type(1+4.0+2)
<class 'float'>
>>> (1+4.0+2)
7.0
c) >>> type(None)
<class 'NoneType'>
d) >>> type('float')
<class 'str'>
e) >>> type(2j*4)
<class 'complex'>
>>> 2j*4
8j
a) y= x+2/2
b) y= x+ 3/3* 2+6
c) y= (x+4)/2*2
d) y= (x+4)/(z+4)*x
a) >>> x=1
>>> z=2
>>> y=x+2/2
>>> y
2.0
b) >>> y=x+3/3*2+6
>>> y
9.0
c) >>> y=(x+4)/2*2
>>> y
5.0
d) >>> y=(x+4)/(z+4)*x
>>> y
0.8333333333333334
a) z= x%y+y
>>> x=12
>>> y=2
>>> z=x%y+y
>>> z
b) z= x//y+x
>>> z=x//y+x
>>> z
18
c) y= x//y z=x//y
>>> y=x//y
>>> z=x//y
>>> z
d) y= x//y+y z= x//y
>>> y=x//y+y
>>> y
>>> z=x//y
>>> z
e) y= x%y+2 z= x%y+x
>>> y=x%y+2
>>> z=x%y+x
>>> z
12
f) y= x//y z= x%(y+2)
>>> y=x//y
>>> z=x%(y+2)
>>> z
g) y= x%y z= x//(y+2)
>>> y=x%y
>>> z=x//(y+2)
>>> z
a) 12.5/2.5
>>> 12.5/2.5
5.0
b) int(12.5)/int(2.5)
>>> int(12.5)/int(2.5)
6.0
c) int(12.5/2.5)
>>> int(12.5/2.5)
a) str(6)* int(‘5’)
'66666'
b) int(”6”)+ float(”6.1”)
>>> int('6')+float('6.1')
12.1
c) str(6) * float(”6.1”)
d) str(6/4) * 2
>>> str(6/4)*2
'1.51.5'
a) 3+4=?
b) (3)(4)
c) x=3; y=4;
d) Răspuns: (3; 4)
Z =(X2 + Y2 ) (X - Y)2
2+3+5=10
2*3*5=30
(2+3+5 )/3=3.333333333
a,b,c = 2,4,8
a = a +4
b = b -3
b=b+a
a=b–a
X= Y
Y=X