Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
6 views

Python Basics Assignment

This assignment for interns at InjivaCodes Business IT Solutions focuses on developing Python programming skills while addressing practical business problems. It includes tasks such as creating greeting messages, calculating sales revenue, monitoring inventory, analyzing sales metrics, generating reports from CSV files, and implementing error handling. Additionally, it emphasizes the importance of documentation, critical analysis, and adherence to coding standards.

Uploaded by

ruemumbire9
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)
6 views

Python Basics Assignment

This assignment for interns at InjivaCodes Business IT Solutions focuses on developing Python programming skills while addressing practical business problems. It includes tasks such as creating greeting messages, calculating sales revenue, monitoring inventory, analyzing sales metrics, generating reports from CSV files, and implementing error handling. Additionally, it emphasizes the importance of documentation, critical analysis, and adherence to coding standards.

Uploaded by

ruemumbire9
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
You are on page 1/ 6

Python Basics Assignment: Critical Analysis and

Business Applications
Overview
This assignment is intended for an intern at InjivaCodes Business IT Solutions. It is
designed to build a foundation in Python programming while simultaneously
cultivating a critical, analytical approach to solving practical business problems.
Interns are expected to implement robust and maintainable code along with thoughtful
documentation that explains the reasoning behind each design decision.

Task 1: Greeting the Team


Objective: Develop a simple script to display a professional welcome message.

Instructions:

Create a file named greeting.py.

The script must output the following message:

Welcome to InjivaCodes Business IT Solutions!

Reflective Inquiry: In your README file, provide a brief discussion on the


significance of establishing a consistent greeting mechanism in automated systems
and customer interfaces. Consider the potential impact on brand image and user
experience in a business environment.

Task 2: Sales Revenue Calculation


Objective: Process a simulated sales dataset to compute the total revenue and analyze
underlying assumptions regarding data quality and structure.

Instructions:

Define a list of dictionaries, where each dictionary includes the following keys:

id (integer)

product_name (string)

quantity_sold (integer)

unit_price (float)

Example:
python
sales_data = [
{"id": 1, "product_name": "Laptop", "quantity_sold": 3,
"unit_price": 1200.50},
{"id": 2, "product_name": "Monitor", "quantity_sold": 5,
"unit_price": 300.75},
{"id": 3, "product_name": "Keyboard", "quantity_sold": 10,
"unit_price": 45.99}]

Implement a function calculate_total_revenue(sales_data) that


calculates the total revenue using the formula:

total_revenue = sum(item["quantity_sold"] * item["unit_price"]


for item in sales_data)

Display the resulting revenue with an appropriate explanatory message.

Critical Considerations:

Identify and document the assumptions made about the dataset's structure and
integrity.

Discuss how missing, incomplete, or corrupted entries might affect the


computation and propose strategies for data validation.

Evaluate the current data model and suggest alternative representations that
could be more suitable for scaling business operations.

Task 3: Inventory Monitoring via Control Structures


Objective: Design a script to monitor inventory levels and notify when restocking is
necessary.

Instructions:

Create a list of dictionaries to represent product information. Each dictionary


must include:

product_name (string)

stock (integer)

threshold (integer)

Example:

python
inventory = [
{"product_name": "Laptop", "stock": 5, "threshold": 10},
{"product_name": "Monitor", "stock": 15, "threshold": 10},
{"product_name": "Keyboard", "stock": 8, "threshold": 10}]
Using a loop and conditional statements, identify products where the available
stock is below the threshold.

For each product meeting this criterion, display a message in the following
format:

Product [product_name] requires a reorder. Current stock:


[stock], Threshold: [threshold].

Reflective Inquiry:

In your README, discuss the limitations of static thresholds within a


dynamic inventory system.

Propose enhancements such as the use of dynamic or product-specific


thresholds and justify these suggestions with pertinent examples.

Task 4: Sales Metrics Analysis


Objective: Develop a function to analyze a set of sales figures and derive key
performance metrics.

Instructions:

Define a list of sales numbers (e.g., [250, 400, 320, 560, 390]).

Write a function analyze_sales(sales_numbers) that computes and returns:

The average sale value.

The maximum sale value.

Format and display the computed metrics clearly.

Reflective Inquiry:

Explain the business relevance of the average and maximum sale values.

Discuss additional metrics (e.g., minimum sale, standard deviation) that might
be beneficial in a comprehensive sales analysis.

Identify potential biases or limitations inherent in the provided dataset and


suggest methods to address them.

Task 5: Business Reporting from a CSV File


Objective: Employ file input/output (I/O) techniques to read and analyze data from a
CSV file, simulating business report generation.
Instructions:

Create a CSV file named sales_report.csv with the following headers and
sample data:

date,region,sales_amount
2025-04-20,North,1200.50
2025-04-21,South,950.75
2025-04-22,East,1100.00

Develop a Python script (report_generator.py) that:

Reads the CSV file using Python’s csv module or standard file I/O.

Calculates the total and average sales.

Presents the aggregated statistics in a clear and structured format.

Critical Analysis:

Identify potential issues such as missing data or misformatted entries and


describe possible pre-processing steps to mitigate these issues.

In your README, discuss the importance of contextual business data and


suggest additional dimensions that could enhance the report’s value.

Task 6: Robust Error Handling


Objective: Implement error management strategies to ensure that file I/O operations
handle unexpected conditions without failure.

Instructions:

Modify your CSV processing code to include a try/except block.

Specifically, account for:

FileNotFoundError (when the CSV file is absent).

ValueError (arising from data conversion issues).

Display informative error messages that could assist in troubleshooting any


problems encountered.

Critical Considerations:

Provide a rationale regarding the scope of exception handling—discuss the


benefits and potential drawbacks of capturing too many versus too few
exceptions.
Document in your README any vulnerabilities that might remain and
propose further enhancements to error management.

Bonus Task: Command-Line Interface (CLI) Integration

Objective: Integrate the various tasks into a cohesive command-line interface (CLI)
that allows users to select and execute specific business analyses.

Instructions:

Develop a menu-based CLI that provides the following options:

Generate and display a revenue summary (Task 2).

Conduct an inventory check and notify when stocks are low (Task 3).

Execute the CSV sales report generator (Task 5).

Utilize Python’s input() function to capture user selections and ensure robust
input validation.

Structure your application so that each menu option triggers the corresponding
function or script developed in earlier tasks.

Analytical Inquiry:

Compare the advantages and limitations of text-based interfaces versus


graphical user interfaces (GUIs) in an enterprise context.

Discuss enhancements such as logging, user authentication, and configurable


settings, and provide a formal justification for each recommended
improvement.

Submission Requirements
Code Quality

The code must be clearly written, well-organized, and appropriately


commented.

Adhere to Python coding standards (including PEP8 guidelines).

Documentation

Include a README.md file that contains:

A concise explanation of the overall approach.

Detailed instructions to execute the scripts.


A thoughtful response to each of the reflective inquiries.

A discussion on potential improvements and alternative strategies.

Files to Submit

All Python source files (.py) implementing the solution.

The CSV file (sales_report.csv).

The README.md file.

Evaluation Criteria

Submissions will be evaluated on the basis of:

Correctness and Efficiency: The technical correctness and performance of


the implemented code.

Critical Analysis: The depth and insightfulness of the reflection on design


choices, data assumptions, and error handling.

Clarity and Maintainability: The logical structure, documentation, and


overall readability of the code and supporting materials.

Conclusion

This assignment is designed not only to evaluate your Python programming skills but
also to encourage a disciplined, reflective approach to problem-solving within a
business context. By methodically analyzing and refining your code, you will develop
the critical thinking required to address real-world IT challenges effectively.

We anticipate that this exercise will provide valuable insights into both the technical
and strategic aspects of business IT operations, preparing you for a dynamic career at
InjivaCodes Business IT Solutions.

You might also like