You are on page 1of 1

B.Tech. (Computer Science & Engineering) (Sem.

– 3)
Programming in Python
Subject Code: BTCS 510-18
Time : 2 Hrs Max. Marks : 30
INSTRUCTIONS TO CANDIDATES:
 Attempt any FIVE question(s), each question carries 6 marks.

Que 1. (a) Analyse String Slicing. Illustrate how it is done in python with Example.
(b) Write a Python code to search a string in the given list.
Que 2. Demonstrate with code the various operation that can be performed on tuples.
Que 3. Detect whether a number is positive, negative, or zero. Try using fixed
values at first, then update your program to accept numeric input from the user.
Que 4. (a) Why are variable name and type declarations not used in Python?
(b) Why are function type declarations not used in Python
Que 5. Create a pair of functions to convert Fahrenheit to Celsius temperature values. C = (F -
32) * (5 / 9) should help you get started. We recommend you try true division with this
exercise, otherwise take whatever steps are necessary to ensure accurate results.
Que 6. (a) We know that dictionary values can be arbitrary Python objects, but what about the
keys? Try using different types of objects as the key other than numbers or strings. What
worked for you and what didn't? As for the failures, why do you think they didn't
succeed?
(b) What dictionary method would we use to combine two dictionaries together?
Que 7. How will you remove all duplicates elements present in a list & tuple?

(b) Which of the following is the correct way to create an empty set?
S1=set() S2={}
What are the types of S1 & S2? How will you confirm the type?

Note:
 Any student found attempting answer sheet from any other person(s), using incriminating
material or involved in any wrong activity reported by evaluator shall be treated under
UMC provisions.
 Student found sharing the question paper(s)/answer sheet on digital media or with any
other person or any organization/institution shall also be treated under UMC.
 Any student found making any change/addition/modification in contents of scanned copy
of answer sheet and original answer sheet, shall be covered under UMC provisions.
IN Case of UMC: All MST will be Cancelled and no Internal Mark’s will be Awarded.

You might also like