AKTU Python Programming (BCC302) Question Paper 2023-24
| University | Dr. A.P.J. Abdul Kalam Technical University (AKTU), Lucknow |
|---|---|
| Course | B.Tech, Semester III |
| Subject | Python Programming (BCC302) |
| Exam | Theory Examination 2023-24 (odd semester) |
| Time · Marks | 3 hours · 70 marks |
| Source | AKTU question paper, from the ABESIT question paper bank |
Note: Attempt all Sections. If require any missing data; then choose suitably.
Section A
Q1. Attempt all questions in brief
- Describe the concept of list comprehension with a suitable example
- Differentiate between / and // operator with an example
- Compute the output of the following python code:
def count(s):for str in string.split():s = “&”.join(str)return sprint(count(“Python is fun to learn.”)) - How to use the functions defined in library.py in main.py
- Describe the difference between linspace and argspace.
- Explain why the program generates an error.
x = [‘12’, ’hello’, 456]x[0] *= 3x[1][1]=’bye’ - Describe about different functions of matplotlib and pandas.
Section B
Q2. Attempt any three of the following
- Illustrate Unpacking tuples, mutable sequences, and string concatenation with 7 examples
- Illustrate different list slicing constructs for the following operations on the 7 following list: L = [1, 2, 3, 4, 5, 6, 7, 8, 9] 1. Return a list of numbers starting from the last to second item of the list 2. Return a list that start from 3rd item to second last item. 3. Return a list that has only even position elements of list L to list M. 4. Return a list that starts from the middle of the list L. 5. Return a list that reverses all the elements starting from element at index 0 to middle index only and return the entire list. Divide each element of the list by 2 and replace it with the remainder.
- Construct a function perfect_square(number) that returns a number if it is a perfect 7 square otherwise it returns -1. For example: perfect_square(1) returns 1
- Construct a program to change the contents of the file by reversing each character 7 separated by comma: Hello!! Output H,e,l,l,o,!,!
- Construct a plot for following dataset using matplotlib :
Food Calories Potassium fatMeat 250 40 8Banana 130 55 5Avocados 140 20 3
SweetPotatoes 120 30 6Spinach 20 40 1Watermelon 20 32 1.5Coconut water 10 10 0Beans 50 26 2Legumes 40 25 1.5Tomato 19 20 2.5
Section C
Q3
Attempt any one part of the following
- Determine a python function removenth(s,n) that takes an input a string and an 7 integer n>=0 and removes a character at index n. If n is beyond the length of s, then whole s is returned. For example:
removenth(“MANGO”,1) returns MNGOremoventh(“MANGO”,3) returns MANO - Construct a program that accepts a comma separated sequence of words as input 7 and prints the words in a comma-separated sequence after sorting them alphabetically. Suppose the following input is supplied to the program: without, hello, bag, world Then, the output should be: bag, hello, without, world
Q4
Attempt any one part of the following
- A website requires the users to input username and password to register. Construct 7 a program to check the validity of password input by users.
Following are the criteria for checking the password:1. At least 1 letter between [a-z]2. At least 1 number between [0-9]3. At least 1 letter between [A-Z]4. At least 1 character from [$#@]
5. Minimum length of transaction password: 6
6. Maximum length of transaction password: 12
Your program should accept a sequence of comma separated passwords and will check them according to the above criteria. Passwords that match the criteria are to be printed, each separated by a comma - Explore the working of while, and for loop with examples.
Q5
Attempt any one part of the following
- Construct a function ret smaller(l) that returns smallest list from a nested list. If 7 two lists have same length then return the first list that is encountered. For example:
ret smaller([ [ -2, -1, 0, 0.12, 1, 2], [3, 4, 5], [6 , 7, 8, 9, 10], [11, 12, 13, 14, 15]])returns [3,4,5]ret smaller([ [ -2, -1, 0, 0.12, 1, 2], [‘a’, ’b’, ’c’, ’d’, 3, 4, 5], [6 , 7, 8, 9, 10], [11,12, 13, 14, 15]]) returns [6 , 7, 8, 9, 10] - Construct following filters: 1. Filter all the numbers 2. Filter all the strings starting with a vowel 3. Filter all the strings that contains any of the following noun: Agra, Ramesh, Tomato, Patna. Create a program that implements these filters to clean the text.
Q6
Attempt any one part of the following
- Change all the numbers in the file to text. Construct a program for the same. Example: Given 2 integer numbers, return their product only if the product is equal to or lower than 10. And the result should be: Given two integer numbers, return their product only if the product is equal to or lower than one zero
- Construct a program which accepts a sequence of words separated by whitespace 7 as file input. Print the words composed of digits only.
Q7
Attempt any one part of the following
- Construct a program to read cities.csv dataset, remove last column and save it in 7 an array. Save the last column to another array. Plot the first two columns.
- Design a calculator with the following buttons and functionalities like addition, 7 subtraction, multiplication, division and clear.
Short on time? See the most repeated AKTU Python Programming questions across all years.
Other years
More AKTU Python Programming papers on LearnAIFast.
This paper is reproduced for study purposes only. Copyright belongs to AKTU. Source: the question paper bank of ABES Institute of Technology, an AKTU-affiliated college. If you own the copyright and want it removed, email learnwithskillnest@gmail.com and we will take it down.