Python Programming Past Paper PDF 18CS34

Document Details

FirmerScholarship9826

Uploaded by FirmerScholarship9826

Dr. Ambedkar Institute of Technology

Dr. Ambedkar Institute of Technology

Tags

python programming model question paper exam paper computer science

Summary

This document is a past paper for a Python Programming exam, part of a B.E. degree program at Dr. Ambedkar Institute of Technology. It includes a variety of questions on Python-related topics, including operators, data types, functions, and more. The document is divided into sections, each with multiple questions and potential solutions.

Full Transcript

(Page 1 of 3) USN 18CS34 B. E. Degree (Autonomous) Third Semester End Examination (SEE) PYTHON PROGRAMMING (Model Que...

(Page 1 of 3) USN 18CS34 B. E. Degree (Autonomous) Third Semester End Examination (SEE) PYTHON PROGRAMMING (Model Question Paper – I) Time: 3 Hours] [Maximum Marks: 100 Instructions to students: Answer FIVE FULL questions RBT Q.No. Questions Marks CO Cognitive Level Describe Arithmetic Operators, Assignment Operators, a) Comparison Operators, Logical Operators and Bitwise 10 CO1 L2 Operators in detail with examples. Explain the Identifiers, Keywords, Statements, Expressions, 1. b) and Variables in Python programming language with 5 CO1 L2 examples. Explain the basic data types available in Python with c) 5 CO1 L2 examples. OR Write Python Program to reverse a number and also find the a) Sum of digits in the reversed number. Prompt the user for 8 CO1 L3 input. 2. Write Pythonic code to check if a given year is a leap year or b) 6 CO1 L3 not. Write Python program to find the GCD of two positive c) 6 CO1 L3 numbers. Write Python code to determine whether the given string is a a) 6 CO2 L3 Palindrome or not using slicing. Explain the use of join() and split() string methods with 3. b) examples. Describe why strings are immutable with an 6 CO2 L2 example. Write Python program to count the total number of vowels, c) 8 CO2 L3 consonants and blanks in a String. Dr. Ambedkar Institute of Technology, Bengaluru – 560056 (An Autonomous Institution Affiliated to Visvesvaraya Technological University, Belgaum) (Page 2 of 3) OR Write Python program to add two matrices and also find the a) 7 CO3 L3 transpose of the resultant matrix. Input five integers (+ve and −ve). Write Pythonic code to find the sum of negative numbers, positive numbers and print 4. b) 7 CO3 L3 them. Also, find the average of all the numbers and numbers above average. Write Pythonic code to find Mean, Variance and Standard c) 6 CO3 L3 Deviation for a list of numbers. Discuss the relation between tuples and lists, tuples and a) 8 CO3 L2 dictionaries in detail. Write Python program to swap two numbers without using 5. b) 6 CO3 L3 Intermediate/Temporary variables. Prompt the user for input. Write a program that accepts a sentence and calculate the c) 6 CO3 L3 number of digits, uppercase and lowercase letters. OR Write Pythonic code to sort a sequence of names according a) 8 CO3 L3 to their alphabetical order without using sort() function. b) Discuss zip() function with an example. 6 CO3 L2 6. Illustrate the following Set methods with an example. c) a) intersection() b) union() c) issubset() d) difference() e) 6 CO3 L2 update() f) discard() Discuss the following special characters in detail. a) 7 CO4 L2 a) \d b) \w c) \b d) {m, n} e) \ f) ? Consider the file structure given below. Write Python program to delete all the files and subdirectories from the Extinct_Animals Directory. b) 6 CO4 L3 7. Describe the difference between Python os and os.path c) modules. Also, discuss the following methods of os module 7 CO4 L2 a) chdir() b) rmdir() c) walk() d) listdir() e) getcwd() OR 8. a) Describe the characteristics of the CSV format. 7 CO4 L2 b) Write Python program to write the data given below to a 7 CO4 L3 CSV file. Category,Winner,Film,Year Best Picture,Doug Mitchell and George Miller,Mad Max: Fury Road,2015 Dr. Ambedkar Institute of Technology, Bengaluru – 560056 (An Autonomous Institution Affiliated to Visvesvaraya Technological University, Belgaum) (Page 3 of 3) Visual Effects,Richard Stammers,X-Men:Days of Future Past,2014 Best Picture,Martin Scorsese and Leonardo DiCaprio,The Wolf of Wall Street,2013 Music(Original Song),Adele Adkins and Paul Epworth,Skyfall from Skyfall,2012 Discuss the following methods of os.path module. c) a) isfile() b) abspath() c) relpath() d) dirname() e) splitext() f) 6 CO4 L2 getmtime() Write Python Program to Calculate Area and Perimeter of a) 10 CO5 L3 different Shapes using Polymorphism. 9. Illustrate the diamond problem in Python programming b) 10 CO5 L2 language with an example. OR Write Python Program to Demonstrate the Construction of a) 10 CO5 L3 Method Resolution Order in Python. Consider a Rectangle Class and Create Two Rectangle 10. Objects. Write Python program to Check Whether the Area b) 10 CO5 L2 of the First Rectangle is Greater than Second by Overloading > Operator. ****** Dr. Ambedkar Institute of Technology, Bengaluru – 560056 (An Autonomous Institution Affiliated to Visvesvaraya Technological University, Belgaum)

Use Quizgecko on...
Browser
Browser