This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def pyramid(n: int) -> list: | |
size = 2 * n - 1 | |
table = [size * [0] for _ in range(size)] | |
for start in range(n): | |
for j in range(size - start): | |
table[start][start + j] = start + 1 | |
for j in range(size - start): | |
table[size - 1][start + j] = start + 1 | |
for i in range(size - start): | |
table[start + i][start] = start + 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import os | |
import pathlib | |
from . import db, config | |
sponsored_id_list = config.get_sponsored() | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import openpyxl # for working with Excel files | |
import pandas as pd # for working with DataFrames | |
from openpyxl.utils.dataframe import dataframe_to_rows # for converting DataFrames to rows in Excel | |
# openpyxl and pandas need to be installed with pip | |
# Function to generate sample data as a DataFrame | |
def generate_sample_data(): | |
return pd.DataFrame({ |
OlderNewer