
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Basic python question and answers
Typology: Exercises
1 / 1
This page cannot be seen from the preview
Don't miss anything!

Q) Write python keywords from the following list of words : And Class PASS if exec PRINT Not. ans) class, if
Q) write python statements for the following equations :
(a) rootl= -b+√( b^2-4ac)/2a => root1 = (-b+math.sqrt (b2-4ac))/2*a
(b) result = ((2xy-9y)/2xy^3)-((4yx^2)/2y) => result = ((2xy-9y)/2xy3)-( (4yx2)/2y)
(c) result = 2cos1/2 (x+y) cos1/2 (x-y) +e^x-1-x/4+tan (x) -log (v) => result = 2*math.cos (0.5 (x+y)) *math.cos(0.5 (x y)) +math.exp (x)-1-x/4+math.tan (x) -math.log (v)
Q) how does the effect of the following two statements differ :
(a)x+=x+ => it is equivalent to x=x+x+10. for example: if x=2, output will be x=14.
(b)x=x+ => it is equivalent to x=x+10. for example: if x=2, output will be x=12.