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

Python Assignment for Data Science BTIBM505

The document outlines a basic Python assignment for Data Science students at Shri Vaishnav Vidyapeeth Vishwavidyalaya, due on September 10, 2022. It includes tasks such as defining Python concepts, performing operations, applying flow control, and using built-in functions across various data types. Students are instructed to submit their assignments in a specified format and within designated folders for their respective sections.

Uploaded by

workclg036
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 Assignment for Data Science BTIBM505

The document outlines a basic Python assignment for Data Science students at Shri Vaishnav Vidyapeeth Vishwavidyalaya, due on September 10, 2022. It includes tasks such as defining Python concepts, performing operations, applying flow control, and using built-in functions across various data types. Students are instructed to submit their assignments in a specified format and within designated folders for their respective sections.

Uploaded by

workclg036
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

Shri Vaishnav Vidyapeeth Vishwavidyalaya, Indore (MP)

Basic Python Assignment


Data Science-BTIBM505 , All Sections - M,D,E
Submission last Date – 10/Sep/2022
You can perform python Code on any IDE - Pycharm,
Jupyter, Colab, Visual Studio Code
1. Define python, variable & data types with their properties
( for Theory use multiline comment/Markdown/Row NB Convert in code line )

2. Performing all operators on variables.


3. Apply flow control - I. if-elif-else II. Break, pass , continue
III. for & while loops ( only perform one - 2 example of these topics in code line )
[Link]

4. Use any five In-build functions on all data types


( string, tuple, list, dictionary, set )
[Link]

Please give the name to assignment file in this manner (Roll no. _name_BP)
and submit file in below in folder ( section wise ) – (Roll no. _name_BP)
20100BTBDAI07199_AADITYA PRATAP SINGH CHOUHAN_BP

Assignment submission Folder & Excel links are –


(fill up the require details in Excel like- Emailid & Cont. no.)

Sec M - [Link]
[Link]

Sec D - [Link]
[Link]

Sec E - [Link]
[Link]

Common questions

Powered by AI

Lists in Python are flexible due to their ability to hold elements of varying types, support dynamic resizing, and offer numerous methods for manipulation, such as append() and sort(). However, they can be inefficient in terms of memory due to their overhead in maintaining dynamic sizing and in performance when searching for items (linear time complexity), which can affect scalability in large datasets .

Built-in functions in Python provide essential utilities that streamline operations on data types. For strings, functions like len(), upper(), and split() can determine length, convert to uppercase, and split a string into substrings, respectively. Tuples benefit from functions like index() and count(). Lists have append() and remove() for item management. Dictionaries use keys() and values() to access their respective elements, while sets utilize add() and remove() for element modification. These functions enable efficient data manipulation and coding practices .

Variable scope in Python determines the accessibility of a variable within the code. Variables defined within a function are local to that function, while those defined outside are in the global scope. Functions can read global variables but require a nonlocal or global declaration to modify them. Understanding scope prevents errors in variable access and reassignment, ensuring code reliability and maintainability .

Dictionaries in Python excel in scenarios requiring a mapping between keys and values, offering constant-time complexity for lookups. If managing configuration settings where each setting’s name (key) must be associated with a specific value, dictionaries allow quick retrieval and modification without needing to traverse a list or deal with index positions, making them more efficient than lists or tuples for such tasks .

'Break' is used to exit a loop prematurely when a certain condition is met, 'continue' skips the current iteration and moves to the next one, and 'pass' acts as a placeholder for future code. These statements control the flow of a loop to improve efficiency or implement logic. 'Break' might end a search when a match is found, 'continue' might skip iterations where conditions aren't met, and 'pass' serves during development when code structure is required but logic is incomplete .

The assignment document outlines organized submission methods, requiring students to name files with specific formats and submit them to designated folders, ensuring each submission's traceability and organization by section. This aligns with best practices by facilitating easy tracking of submissions, reducing file management complexity, and allowing efficient feedback distribution, enhancing learning and administrative processes .

Operators in Python enable various computations and logical operations on variables. Arithmetic operators like +, -, *, and / perform mathematical operations. Assignment operators such as = and += assign values to variables. Comparisons use operators like == and != to compare values, while logical operators like and, or, not manage boolean logic. For example, using + to concatenate strings or * to multiply numerical values .

The 'if-elif-else' structure in Python is used for decision making, allowing the execution of code depending on one or multiple conditions. 'for' loops iterate over a sequence (e.g., a list or string), executing a block of code for every item. 'while' loops continue to execute a block of code as long as a condition holds true, offering a method to repeatedly run code based on dynamic conditions .

Immutability in data types like tuples and strings means once an object is created, its state cannot be modified. This offers advantages like simplifying concurrent access to the data, ensuring hashability needed for set elements or dictionary keys, and allowing for safer code with predictably stable data structures. However, immutability can lead to increased memory usage and the need to create new objects instead of modifying existing ones .

Python is an interpreted, high-level, and general-purpose programming language known for its readability and simplicity. Variables in Python serve as storage locations with a symbolic name, bounded to a value. Python's data types, such as int, float, string, and list, each have specific properties that dictate their operations and functionalities. For instance, strings are immutable sequences of characters, whereas lists are mutable sequences of items, allowing for modification .

You might also like