0% found this document useful (0 votes)
4 views

Python Assign1 2024-25 f

This document outlines the tutorial/assignment for the Introduction to Python course at CBIT-KOLAR, detailing the questions and topics covered across three modules. The assignment is due on November 20, 2024, and includes questions on arithmetic expressions, flow control statements, exception handling, lists, tuples, and string handling methods. Students are required to answer all questions provided in the assignment.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Python Assign1 2024-25 f

This document outlines the tutorial/assignment for the Introduction to Python course at CBIT-KOLAR, detailing the questions and topics covered across three modules. The assignment is due on November 20, 2024, and includes questions on arithmetic expressions, flow control statements, exception handling, lists, tuples, and string handling methods. Students are required to answer all questions provided in the assignment.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

CBIT-KOLAR

DEPARTMENT: Computer Science & Engineering


TUTORIAL/ASSIGNMENT–1
Date of announcement:09-11-2024 Last date to submit:20-11-2024
SEM:I SUBJECT: Introduction to Python SUBCODE: BPLCK105B
D,E,F Programming

SL QUESTIONS MARKS
NO
MODULE 1
1 What is Arithmetic expression, what is the output of this statement ‘hello 7
world’+100+’how are you’ explain the reason if the statement produce an error.
2 (a). What is flow control statement? Discuss if and if else statement with flow chart. 8
(b). Explain looping control statement in python with syntax and example to each.
3 With Python programming example to each, explain the syntax and control flow diagram 6
of break & continue statement.

4 Explain two ways of importing modules into application in python with syntax and suitable 7
programming example.
5 What is function? How to define function in Python? Explain with suitable example. 7
6 Explain local & global scope of a variable in python with example? 6
Explain four scope rules of variable in python.
7 What is exception handling? How exception are handled in python. WAPP with exception 7
handling code to solve divide by zero.
8 a) Explain the math operators in python from highest to lowest precedence with example 7
for each. Show steps to evaluate (5-1)*(7+1)(3-1) in python.
b) List and define comparison operators in python. Write the output for the following
expression in python
i) 2**3 ii) 20%6 iii) 20/6
9 Give one example for each of the operation below in python language 8
a) String concatenation & replication
b) Read input & display
10 Explain 7
i) def statement with parameters.
ii) return value & return statement with example.
MODULE 2
13 Explain append (), index (), copy.copy() & copy.deep copy() function with respect to lists in 7

python.
14 What is a list? Explain the concept of list slicing with example. 8

15 For a=[‘hello’, ‘how’,[123],[[10,20,30]]] 7

What is the output of the following statement.

i) print(a[::])

ii) print(a[-3][0])

iii) print(a[2][: -1])

iv) print(a[0][:: -1])


16 Explain the following with example. 10

a) List concatenation & list replication.

b) The in and not in operator.

c) Insert() ,remove(), sort()


17 What is tuple data type? Explain list () & tuple() functions with example. 6

18 (a) Develop a program to read the student details like Name, USN, and Marks in three 5+5

subjects. Display the student details, total marks and percentage with suitable messages.

(b) Develop a program to read the name and year of birth of a person. Display whether the
person is a senior citizen or not.
19 Read a multidigit number from console. Develop a program to print the frequency of each digit 6
with a suitable message.
20 Explain different steps involved in clipboard function of Wiki markup, with a suitable python 8
program.
21 Compare list and dictionary data structure with respect to python language. 6
22 Explain the following with an example. 12
a) keys() b) values() c) items() d) get() e) setdefault()
f) pretty print
23 i) Develop a python program for tic tac toe board. 8+5
ii) Define dictionary. With an example explain nested dictionary.
CBIT-KOLAR

MODULE 3
24 Explain python string handling method with examples. 5
a) split( ) b) endswith( ) c) ljust() d) center() e) lstrip()
25 Explain reading and saving python program variables using shelve module with a suitable 7
python program.
26 Explain python string handling methods with examples 5
a) join() b) startswith() c) rjust() d) strip() e) rstrip()

Note: Answer All Questions For Assignment 1

Prepared by Approved by HOD

Date & sign Date & sign

You might also like