Code: 155612Computer Science & Eng.6th Semester1 Examination Papers

Python Programming

Official Bihar Engineering University examination question papers, marks distribution, and questions transcript. Available exam sessions: 2026.

Get Instant AI Answers on this Paper

Open BEU Connect Android app to solve any numerical or derive formulas step by step.

Ask AI in App
Official Exam Paper TranscriptB.Tech 6th Semester Examination, 2026
Bihar Engineering University, Patna
B.Tech 6th Semester Exam., 2026

Python Programming

Time: 03 HoursCode: 155612Semester: VIFull Marks: 70

Instructions:

  1. The marks are indicated in the right-hand margin.
  2. There are NINE questions in this paper.
  3. Attempt FIVE questions in all.
  4. Question No. 1 is compulsory.
Q.1 Choose the correct option / answer the following (Any seven question only):[2 x 7 = 14]
  1. Which of the following statements about indentation in Python is correct?

    1. Indentation is optional and used only for readability
    2. Indentation determines the scope/block of statements
    3. Indentation is required only inside functions
    4. Python uses braces {} instead of indentation
  2. a = 10
    b = 3
    c = 2
    result = a + b * c ** 2
    print(result)
    The value of result is:

    1. 676
    2. 28
    3. 22
    4. 32
  3. Which statement is used to skip the remaining statements of the current iteration of a loop and proceed with the next iteration?

    1. break
    2. continue
    3. pass
    4. return
  4. for i in range(1, 6):
        if i == 3:
            continue
        print(i, end=" ")
    What is the output?

    1. 1 2 3 4 5
    2. 1 2 4 5
    3. 1 2 3
    4. 4 5
  5. Which statement about a Python list is correct?

    1. A list cannot contain duplicate elements
    2. A list is immutable
    3. A list can contain elements of different data types
    4. A list can contain only numeric values
  6. L = [10, 20, 30, 40, 50]
    print(L[1:4])
    The output is:

    1. [10, 20, 30]
    2. [20, 30, 40]
    3. [20, 30, 40, 50]
    4. [10, 20, 30, 40]
  7. Which statement about a tuple is correct?

    1. Tuples are mutable
    2. Tuples cannot contain duplicate elements
    3. Tuples are immutable
    4. Tuples can contain only numeric values
  8. Which file mode opens a file for reading binary data?

    1. r
    2. w
    3. rb
    4. br
  9. Which OOP concept allows a derived class to acquire properties and methods from a base class?

    1. Polymorphism
    2. Inheritance
    3. Compilation
    4. Iteration
  10. Which of the following is a suitable application of NumPy?

    1. Creating HTML pages
    2. Numerical and array-based computations
    3. Sending emails
    4. Managing operating-system processes only
Q.2 Solve both questions :[7 x 2 = 14]
  1. Describe the arithmetic and relational operators in Python with suitable examples. Write a Python program to demonstrate their use.

  2. Explain type conversion in Python. Differentiate between implicit and explicit type conversions with suitable code examples

Q.3 Solve both questions :[7 x 2 = 14]
  1. Write a Python program to find the largest of three numbers using appropriate decision control statements.

  2. Explain the scope and lifetime of variables in Python with suitable examples.

Q.4 Solve both questions :[7 x 2 = 14]
  1. Write a Python program using for and while loops to generate a sequence of numbers from 1 to 10. Explain the working of the loops used.

  2. Write a Python program to demonstrate commonly used string methods such as upper(), lower(), replace(), split() and join().

Q.5 Solve both questions :[7 x 2 = 14]
  1. Write a Python program to perform basic operations on a list such as adding, removing, updating and accessing elements. Explain the operations used.

  2. Explain list indexing and slicing in Python with suitable examples. Write a Python program to access and extract specific elements from a list using indexing and slicing.

Q.6 Solve both questions :[7 x 2 = 14]
  1. Consider the following dictionary:
    student = {"Name": "Shyam", "Age": 18, "Branch": "CSE", "Marks": 85}
    Write Python statements to perform different operations such as accessing values, adding a new key-value pair, modifying a value, deleting an item and displaying all keys and values.

  2. Explain the built-in functions and methods available for tuples in Python with suitable examples.

Q.7 Solve both questions :[7 x 2 = 14]
  1. Write a Python program to create a text file, write data into it and read the contents of the file. Explain the file operations used.

  2. Write a Python program to read a text file and count the number of lines, words and characters in the file. Explain the approach used.

Q.8 Solve both questions :[7 x 2 = 14]
  1. Explain Object-Oriented Design in Python. Discuss how OOP concepts are used in designing Python programs.

  2. What is Inheritance? Explain single inheritance in Python with a suitable example.

Q.9 Write short note on any two of the following:[7 x 2 = 14]
  1. Operator Precedence and Associativity

  2. zip() Function in Python

  3. Binary Files in Python

  4. NumPy and Its Applications

Related Official Syllabus

Python Programming Lab

105620P

Official BEU curriculum units & topics for this examination subject.

Subject name matches ('Python Programming Lab'), but PYQ code is '155612' / papers [155612] vs Syllabus code '105620P'.

Topics Part 1

Write a program to demonstrate different number data types in Python • Write a program to perform different Arithmetic Operations on numbers in Python • Write a program to create, concatenate and print a string and accessing sub-string from a given string • Create a variable "number" and assign an Integer to the number. Check the assigned Integer is "Positive" or "Negative" • Write a program to find the largest element among three Numbers • Write a program to print the sum of all the even numbers in the range 1 - 50 and print the even sum • Write a Program to display all prime numbers within an interval of 20 and 50 • Write a program to swap two numbers without using a temporary variable • Write a program to define a function with multiple return values • Write a python program to find factorial of a number using Recursion • Write a python script to print the current date in the following format "WED 09:02:26:23 IST 2020" • Write a Python program to convert temperatures to and from Celsius, Fahrenheit [Formula: c/5 = f-32/9] • Write a Python script that prints prime numbers less than 20 • Write a program to print the following patterns using loop: * ** *** **** • Write a program to print multiplication tables of 8, 15, 69 • Write a program to check whether the given input is digit or lowercase character or uppercase character or a special character (use 'if-else-if' ladder) • Write a python Program to print the Fibonacci sequence using while loop • Write a program to find the length of the string without using any library functions • Write a program to check if two strings are anagrams or not • Write a program to check if the substring is present in a given string or not. (use regular expressions) • Write a program to perform the given operations on a list: i. add ii. Insert iii. slicing • Write a program to perform any 5 built-in functions by taking any list • Write a program to get a list of the even numbers from a given list of numbers (use only comprehensions) • Write a program to implement round robin • Write a program to create tuples (name, age, address, college) for at least two members and concatenate the tuples and print the concatenated tuples • Write a program to return the top 'n' most frequently occurring chars and their respective counts. e.g. aaaaabbbbcccc, 2 should return [(a 5) (b 4)] • Write a program to count the number of vowels in a string (No control flow allowed) • Write a program that displays which letters are present in both strings • Write a program to sort given list of strings in the order of their vowel counts • Write a program to generate a dictionary that contains numbers (between 1 and n) in the form of (x, x*x) • Write a program to check if a given key exists in a dictionary or not • Write a program to add a new key-value pair to an existing dictionary • Write a program to sum all the items in a given dictionary • Write a program to sort words in a file and put them in another file. The output file should have only lower case words, so any upper case words from source must be lowered. (Handle exceptions) • Write a program to find the most frequent words in a text. (read from a text file)

View Complete 6th Semester Syllabus

Prepare Better with BEU Connect

  • Download papers for 100% offline study
  • Ask AI for step-by-step problem breakdown
  • Attempt official GATE CBT mock tests
  • Calculate SGPA and track attendance
Download Android App