0% found this document useful (0 votes)
3 views1 page

Python Assignment 2

This document is an assignment for a B.Tech. course in Python Programming, detailing questions across three sections. Section A includes five short answer questions, Section B contains three programming tasks, and Section C features three explanatory questions. The total marks for the assignment are 64, distributed among the sections.

Uploaded by

teenasharma02005
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

Python Assignment 2

This document is an assignment for a B.Tech. course in Python Programming, detailing questions across three sections. Section A includes five short answer questions, Section B contains three programming tasks, and Section C features three explanatory questions. The total marks for the assignment are 64, distributed among the sections.

Uploaded by

teenasharma02005
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

[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.

You might also like