Chloe Louise Paine
Q1. Find the outcome of this code (Trace table).
A=3
B=5
C=-4
while(A<=B):
A=A+1
if(C<=A):
C-=1
print(A, B, C)
change the code and find the answer when A=10 , B=12 , C=0 and find the answer ? and how any
iteration while loop ?
Q2. Write a code to print this shape
*
* *
* * *
for i in range(1,6):
for j in range(1,6):
if(j<=i):
print('*', end=' ')
else:
print(end='\n ‘)
print(end=' ')
Q3. Find a code to print this shape
*
* *
* * *
Q1. Find the outcome of this code (Trace table).
A=3
B=5
C=-4
while(A<=B):
A=A+1
if(C<=A):
C-=1
print(A, B, C)
change the code and find the answer when A=10 , B=12 , C=0 and find the answer ? and how any
iteration while loop ?
Q2. Write a code to print this shape
*
* *
* * *
for i in range(1,6):
for j in range(1,6):
if(j<=i):
print('*', end=' ')
else:
print(end='\n ‘)
print(end=' ')
Q3. Find a code to print this shape
*
* *
* * *