main.py Clear Console 1 import matplotlib.pyplot as plt import numpy as np # 1. Generate some data x = np.linspace(0, 10, 100) y = np.sin(x) # 2. Create a plot plt.figure(figsize=(6, 4)) plt.plot(x, y, label='Sin(x)', color='blue') plt.title('Sine Wave - Matplotlib in Browser') plt.xlabel('X Axis') plt.ylabel('Y Axis') plt.legend() plt.grid(True) # 3. Display the plot # Use this helper function to render the chart in the console show_plot() print("Plot generated successfully!") Console Output Run Code
query.sql Clear Results 1 -- Create a sales table CREATE TABLE IF NOT EXISTS sales ( id INTEGER PRIMARY KEY, product TEXT, amount REAL, date TEXT ); -- Insert sample data INSERT INTO sales (product, amount, date) VALUES ('Widget A', 150.00, '2023-10-01'), ('Widget B', 200.50, '2023-10-02'), ('Gadget X', 99.99, '2023-10-01'), ('Widget A', 120.00, '2023-10-03'); -- Calculate total sales per product SELECT product, SUM(amount) as total_sales, COUNT(*) as units_sold FROM sales GROUP BY product ORDER BY total_sales DESC; Result Set Execute