0% found this document useful (0 votes)
4 views4 pages

PYTHON-1

Python program questions

Uploaded by

Sree Sree
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
4 views4 pages

PYTHON-1

Python program questions

Uploaded by

Sree Sree
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 4
Time: 2 hrs Branch-Inform vine ht Sectio i Answer Al uestions All Questions ey 1. How do you create a string in Python? ) Using single or double quotes ©) Using parentheses() Hi 2. How would you extract "Pyt" from “yon using sli a) "Python"{0:2] c) "Python" [1:3] 3. What is the output when we execu a) [herr Py ‘o’) b) [*hello’ 4. Which of the following is a Python tuple? a) [1, 2, 3] b) (1,2, 3) 5. What will be the output of the following Python code? nums = set({1,1,2,3,3,3,4s4)) a print(len(nums)) a)7 b) Error 6. In the dictionary, which symbol is used b) a), H Section B (343 Answer ALL Questions All Questions carry EQUAL Marks 7a. Explain String Literals and its manipulations in Python, (OR) 7a, Classify String methods in Python with examples. 8a, Explain: Access, Change, Add and Remove list items in Python. (OR) 8b. Explain :Different types of Looping, Sorting in Python with example. 9a, Explain about copying, Joining List in Python with example. (OR) 9b. Explain about Set methods in Python, Section C (3*5=15 Marks) Answer ALL Questions All Questions carry EQUAL Marks 10a, Explain: i) Variables and the Assignment Statement. ii) Data types and Character Sets in Python, (OR) 10b. Summarize: i) Arithmetic Expressions ii) Mixed - Mode Arithmetic and Type C La, Explain in detail about Tuples in Python with examples. — (OR) 11b, Explain about List methods in Python. 12a. Write about Set in Detail with example. t (OR) 12b. Explain Dictionaries in Python with suitable example, fe eeeen ene PSG College of Arts & Science ae (Autonomous) BBA Degree Ex; nination-October 2024 Branch-Information Systems Fifth Semester Python Programming ‘Time: 3 hrs Maximum: 50 marks Continuous Assessment Test-II Section A (5*1=5 Marks) Answer ALL Questions All Questions carry EQUAL Marks 1 What will be the output of the following code snippet? x="Hello" print(type(x)) a) hello b)ste ©) string 4d) list 2. Which data type is used to store a collection of items, where each item is indexed by a key?. a) List b) Tuple ©) Set 4) Dictionary 3. Immutable mean: a) Tuple cannot be changed after it has been created b) Tuple can be changed after it has been created ©) Creation of array 4) Datatypes can be changed 4. What is the primary purpose of the if statement in Python? a) To execute a block of code based on a condition b) To perform mathematical operations c) To repeat a block of code 4) To define a function 5. To open a file e:\scores.txt for writing, we use a) outfile = open(“c:\scores.txt”, “w”) b) outfile = open(“cs\\scores.txt”, “w”) ©) outfile = open(file = “c:\scores.txt”, “w”) 4) outfile = open({file Answer ALL questions ALL questions carry EQUAL Marks a) Explain String slicing and modify string in Python, OR o b) Explain Concatenate Strings and Format Strings, 7 a) Explain: Sort, Copy, Join list items in Python, b) Write about methods of Set in Detail with paroles r 8 a) What are the manipulations can be done with Tuple i in Python? b). Explain functions cake in Python. 9 a) Define Classes and Oi in Python, b) How to define see of Classes in Python with example’ r 10 a) Explain in detail about Text files and their formats, b) How to write a text cane in Python with suitable example? SECTION -C (30 Marks) Answer ALL questions ALL questions carry EQUAL Marks — 11 a) Classify String methods in Python with examples. b) Summarize: a i) Arithmetic Expressions ii) Mixed - Mode Arithmetic and Type Conversions Sy 12 a) Explain Manipulations in Python List with example. OR b) Explain in detail about Tuples in Python with examples. 13 a) Write about Set in Doel with example, ) Explain in detail about Exception handling in Python, 15 a) How to add, remove and loop items in Python Dictionary. OR b) How to read and write the number into a file with suitable e. Sec

You might also like