[Link].
(Computer Science and Engineering)
Semester-IV
Subject: Python Programming (BCO081B)
Marks:64
Assignment#2
Section-A Answer the following Questions: (5*2=10marks)
1. What is String Formatting in Python?
2. What is the purpose of the break statement in Python?
3. List the different string operations in python.
4. What is Transfer statement in Python?
5. How are strings created and stored in Python?
Section-B Answer the following Questions: (7x3=21Marks)
1. Write a Python program to find the sum of all numbers from 1 to 100 using a for loop.
2. What is the purpose of the range() function in Python? Write a program to print
numbers from 1 to 10 using range() in a for loop.
3. Write a Python program to concatenate two strings and print the result.
Section-C Answer the following Questions: (11x3=33Marks)
1. Explain the difference between if-else and if-elif-else statements. Provide an example.
2. Explain string slicing in Python with an example.
3. Explain the difference between conditional statement & Iterative statement in Python
with the help of Example.