You are tasked with implementing a Python program that analyzes the frequency of characters in a given text file.
Requirements:
Implement a Python program that takes a text file as input and analyzes the frequency of each character in the file.
The program should calculate the frequency of each character (including letters, numbers, symbols, and whitespace) and display the results in descending order.
Ignore case sensitivity when counting character frequencies (e.g., 'A' and 'a' should be considered the same character).
Exclude any characters that are not present in the file from the frequency analysis.
Provide a command-line interface (CLI) for the user to specify the input file and view the character frequency analysis.
Guidelines:
Focus on writing clean, modular code with proper error handling.
Consider using appropriate data structures to store and manipulate the character frequencies efficiently.
Utilize built-in Python functions and methods to simplify the implementation.
Include clear instructions on how to run the program and specify the input file.
Deliverables:
Python code file for the character frequency analyzer program.
A README file explaining how to use the program and any additional notes.
Assignment 2: URL Shortener
You are tasked with building a simple URL shortener service using Python. The service should take a long URL as input and generate a shortened URL that redirects to the original long URL when accessed.
Requirements:
Implement a Python function called shorten_url that takes a long URL as input and returns a shortened URL.
The shortened URL should be unique for each long URL provided.
When a user accesses the shortened URL, it should redirect them to the original long URL.
You can use any Python web framework of your choice (e.g., Flask, Django) to implement the URL shortener service.
Include clear instructions on how to run and test the application.
Guidelines:
Focus on writing clean and maintainable code.
Use appropriate data structures and algorithms to ensure efficient and reliable performance.
Consider error handling and edge cases.
Write a brief explanation of your implementation choices, including any design patterns used (if applicable).
Avoid using third-party libraries for URL shortening.
Deliverables:
Python code files for the URL shortener service.
A README file explaining how to set up and run the application.
Any additional documentation or notes on your implementation.
Want to print your doc? This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (