You are on page 1of 6

Name: Manisha Prasad

Reg_Id: 12323962
SECTION: Q2346
COURSE: MGNM801 “BUSINESS ANALYTICS”
1ST CA

Unit – 1
Parts of Python Programming Language
Q1 Identifiers, Keywords, and Comments: (Attempt any one)
1. Choose three different identifiers and explain whether they are valid or not.
Justify your answer.

2. List and explain the purpose of three Python keywords.

Q2 Variables, Operators, and Data Types: (Attempt any one)


1. Declare a variable of each of the following data types: integer, float, string,
and boolean. Initialize them with sample values.
2. Perform operations using arithmetic operators (+, -, *, /) on the integer and
float variables and display the results.
Q3 Indentation and Statements: (Attempt any one)
1. Write a Python script with conditional statements (if, elif, else) to check if a
given number is positive, negative, or zero.

2. Use proper indentation to show the block structure.


Unit – 2
Strings and Lists
Q1 Basic String Operations: (Attempt any one)
1. Create a string variable containing your full name.
2. Calculate the length of the string and print it.

Q2 Accessing Characters in a String: (Attempt any one)


1. Use indexing to print the first character of your name.
2. Use indexing to print the last character of your name.

Q3 String Slicing and Joining: (Attempt any one)


1. Use string slicing to extract the word "Python" and print it.

2. Use the split() method to split the string into words and store them in a list. Then
join the words with a hyphen (-) and print the result.
Unit – 3
Dictionaries
Part 1: Dictionaries
Q1 Creating a Dictionary:
1. Create a dictionary named “student_info” with the following key-value pairs: “name,”
“age,” “grade,” and “city.”

Q2 Accessing and Modifying Key-Value Pairs: (Attempt any one)


1. Access and print the value associated with the "age" key in the
"student_info" dictionary.
2. Modify the "city" value to represent a new city, and print the updated dictionary.

Part 2: Tuples
Q1 Creating Tuples:
1. Create a tuple named "months" with the names of the twelve months of the year.

Q2 Basic Tuple Operations: (Attempt any one)


1. Print the length of the "months" tuple.
2. Check if a specific month is present in the tuple and print the result.
OUTPUT

You might also like