XII CS Python Assignment 1
XII CS Python Assignment 1
CLASS XII CS
Q1. Find the output
i. p=5/2 ii. iii. iv. v.
q=p*4 p=10 a=(2+3)**3-6/2 name='Neeru' a,b,c=10,20,30
r=p+q q=20 b=(2+3)*5//4+(4+6)/2 age=21 p,q,r=c-5,a+3,b-4
p+=p+q+r p*=q//3 c=12+(3*4-6)/3 print(name,"you are", age," now print(‘p ,q and r: ‘,p,q,r)
q-=p+q*r q+=p+q**2 d=12%5*3+(2*6)//4 but",)
print(p,q,r) print(p,q) print(a,b,c,d) print("you will be ", age+1," next
ans(27.5 - ans(60 480) ans(122.0 11.0 14.0 9) year")
142.5 12.5)
xi. xii.
a=10 c=65
b=3 print(chr(c))
c=int(a/b) print(chr(c+1))
d=float(a//b) print(chr(c+2))
print(c,d) ans
ans(3 3.0) A
B
C
Q2. Write Python expressions:- Q3. What is the problem in the code:-
i. ii. iii. a + a+2 i. Ii.
a+b 32+93 b Name=”Prateek” a=3
2 2 Age=26 S=A=10
Print(Your name & age are”,Name+age) A=”New”
Q=A/10