0% found this document useful (0 votes)
10 views1 page

Python Programming Exam Guide

This document outlines the course details for a 6th semester Bachelor of Science in Information Technology degree program. The subject is Python Programming, which is worth 100 marks and consists of two sections - Section A is worth 40 marks and involves answering 4 short questions out of 6 provided, while Section B is worth 60 marks and involves answering 4 longer questions out of 6 provided. The questions cover various topics related to Python programming concepts and features.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views1 page

Python Programming Exam Guide

This document outlines the course details for a 6th semester Bachelor of Science in Information Technology degree program. The subject is Python Programming, which is worth 100 marks and consists of two sections - Section A is worth 40 marks and involves answering 4 short questions out of 6 provided, while Section B is worth 60 marks and involves answering 4 longer questions out of 6 provided. The questions cover various topics related to Python programming concepts and features.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

SIKKIM PROFESSIONAL UNIVERSITY

Course: Bachelor of Science (Information Technology)

Subject: Python-Programming

Semester: 6

Marks: 100

Section A

(4 × 10 = 40)

Attempt any four the following

1. What are the features of python programming language?

2. Write methods and description for strings method.

3. What are the methods for comparison of string in Python?

4. What is Control Statements?

5. What is a function in Python?

6. What is Flow of Execution?

Section B

(4 × 15 = 60)

Attempt any four the following

1. Explain the different ways of Running Python Program.

2. Explain the types of operators that support Python.

3. What is the benefit of using tuple assignment in Python?

4. The Difference between Brackets, Braces, and Parentheses

5. Explain the type Conversion Functions.

6. What is recursion? Write example of a recursive function.

Common questions

Powered by AI

Python offers several methods for string comparison including ==, !=, <, >, <=, >= which allow numeric-like comparisons based on lexicographical order. The cmp() function (removed in Python 3) provided a more explicit comparison in earlier versions. Additionally, methods like str.casefold() can normalize case differences for more accurate comparisons .

Control statements such as if, elif, else, for, while, and break/continue are essential for directing the flow of a program. They enable decision-making, looping, and conditional execution, allowing developers to execute specific blocks of code based on certain conditions, thus enhancing the logical flow and structure of programs .

The flow of execution in Python refers to the order in which statements in a script are executed, typically from top to bottom. Understanding this flow helps in debugging and managing control structures like loops and conditional statements effectively. It ensures that code is logical and performs the intended operations in the correct sequence .

A function in Python is a block of reusable code that performs a specific task. Defined using the def keyword, functions can take inputs, execute a series of statements, and return outputs. Functions are crucial for code organization, reducing redundancy, fostering reuse, and improving readability and maintainability .

Type conversion functions such as int(), float(), str(), and bool() in Python facilitate the conversion of one data type to another. They are used to ensure proper data type handling and compatibility, particularly when performing operations that require specific types, like arithmetic operations or string concatenations .

Recursion in Python is a technique where a function calls itself to solve smaller instances of the same problem. It is particularly useful for tasks like traversing data structures, implementing algorithms like factorial calculation or Fibonacci sequences. For example, a recursive function to calculate factorial would call itself with decreasing values until reaching the base case .

In Python, parentheses are used for tuple creation and function calls, brackets are used for lists and indexing, while braces are used for sets and dictionaries. Each serves distinct syntactic purposes, facilitating the creation and manipulation of various data structures within the language .

Python string methods enable efficient text manipulation through various functionalities such as changing case (upper(), lower()), trimming whitespace (strip(), rstrip(), lstrip()), replacing substrings (replace()), and finding substrings (find(), rfind()). These methods allow developers to perform complex text-processing tasks easily .

Python is renowned for its simplicity and readability, making it accessible for beginners. It supports multiple programming paradigms, including procedural, object-oriented, and functional programming. Python also has a comprehensive standard library and dynamic type system, which adds to its versatility. Additionally, it is open-source and has extensive community support .

Tuple assignment in Python allows simultaneous assignment of multiple variables, such as a, b = 1, 2. This feature simplifies code readability and reduces the lines of code, enabling developers to swap values without a temporary variable and to unpack iterable objects conveniently .

You might also like