Code
import pandas as pd
def main(inputs):
m=inputs['multiplier']
r=inputs['range']
rows=[[m,i+1,m*(i+1)] for i in range(r)]
#col2=[i+1 for i in range(r)]
#col3=[col1[i]*col2[i] for i in range(r)]
#columns=[col1,col2,col3]
ColumnHeaders=["First Number", "Second Number","Product"]
a=pd.DataFrame(data=rows, columns=ColumnHeaders)
#print(a)
table=a.to_html(index=False)
return {"Multiplier": m, "Table":table }
Output
The following is the multiplication table of {{outputs.Multiplier}} {{ outputs.Table }}
Copyright © MecSimCalc 2025
Terms | Privacy