0% found this document useful (0 votes)
13 views

Assignment questions

The document outlines various programming tasks primarily focused on data manipulation using Python, including creating Excel files, generating tables, and processing CSV data. Key tasks involve using libraries like openpyxl and handling different file formats and delimiters. Additionally, it includes object-oriented programming concepts with classes for geometric shapes and time management.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Assignment questions

The document outlines various programming tasks primarily focused on data manipulation using Python, including creating Excel files, generating tables, and processing CSV data. Key tasks involve using libraries like openpyxl and handling different file formats and delimiters. Additionally, it includes object-oriented programming concepts with classes for geometric shapes and time management.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

1.​ A company maintains product sales data in an Excel file named sales_data.xlsx.

Write a program using the openpyxlmodule to create a bar chart representing total
sales for each product category and save the updated workbook as
sales_chart.xlsx.
2.​ Develop a program divisionTable.py that takes a number N from the command line
and generates an N×N division table (where each cell contains the result of dividing row
number by column number) in an Excel spreadsheet.
3.​ Outline a python program to count occurrences of characters in a string and print the
count
4.​ Develop a dictionary of people with their birthday, display birthdate for a person if his
name in the dictionary otherwise add that person name to existing dictionary.
5.​ Imagine you're managing an online store, and each product has a unique code like
"P23ELEC150", where:
a.​ P23 indicates the product series.
b.​ ELEC specifies the category (Electronics).
c.​ 150 represents the product ID.
Develop a program to:
1.​ Print each character of the product code individually.
2.​ Extract and display the series, category, and product ID.
6.​ Develop a program to sort the contents of a text file and write the sorted contents into a
separate text file.
7.​ A company stores sales data in an Excel file. Develop a program how you would read
and process the data to calculate total sales using the openpyxl module
8.​ You are working with a CSV file containing customer feedback data. The file uses a pipe
(|) as the delimiter instead of a comma, and each row ends with a semicolon (;) instead of
the usual newline character. Your task is to illustrate how to read this file and convert it
into a standard CSV format using Delimiter and Line terminator keyword.
9.​ You are working as a data analyst for a company that processes large datasets received
from various vendors. These datasets are in CSV format, and each file contains a header
row that describes the columns. However, the company’s proprietary data processing
software cannot handle files with headers, Develop a python program to remove the
header in all the files for the further process in a company.
10.​Develop a program multiplicationTable.py that takes a number N from the command line and
creates an N×N multiplication table in an Excel spreadsheet. Imagine a Class Rectangle
with instance attributes width and height. This class should contain another attribute
“corner” which is an instance of another class called as Point. The Point class should
have attributes:
a.​ x: The x-coordinate of the corner.

b.​ y: The y-coordinate of the corner.


Develop a program to:
●​ Calculate the area of the rectangle.
●​ Calculate the perimeter of the rectangle.
Display the rectangle's dimensions and corner coordinates
11.​Develop a Class called as Time with hour, min and sec as attributes. Show how two Time
objects are created and create a function that accepts a Time object and adds 5000
seconds to it and display the updated time
12.​You are working with a CSV file containing data from weather sensors. The file uses a
tab (\t) as the delimiter and a colon (:) as the line terminator. Write a program to read
this file, process the data, and convert it into a standard CSV format with commas as
delimiters and newlines as line terminators.

You might also like