You are on page 1of 1

GALGOTIAS COLLEGE OF ENGINEERING AND TECHNOLOGY

1, Knowledge Park-II, Greater Noida, U.P.


Odd Semester 2023-24

Python Programming BCC-302


ASSIGNMENT-2

CO-2: Express proficiency in the handling of strings and functions

Q1. Explain different conditional statements in Python using code examples?

Q2. Draw a flow chart to find largest of three numbers input. Write a program a to find
largest of the three numbers input according to the flowchart?

Q3. What is the output of following code fragment?


i=0
while i< 3:
print(i)
i += 1
else:
print(0)

Q4. Explain the following loops with a flow diagram, syntax, and suitable examples.
I) For II) while.

Q5. Explain continue, break, and pass statements with suitable examples.

Q6. Write a program to determine if the year input by user is a leap year or not.

Q7. What is short circuiting in Python? Give examples.

Q8. Write a program to calculate the reverse of any entered number.

Q9. Program to check whether a number input is divisible by 2 or 3 using nested if.

Q10. Write a Python program to construct the following pattern, using a nested for loop.
*
**
***
****
*****
****
***
**
*

You might also like