@iamawesome10901/

css menu web write helper

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
names = ["burger","fries"]
prices = [5.19,7.49]

def item(name, price, cal, image="none"):
  if(image != "none"):
   html = "<a><img src='" + image + "'><span class='name'>" + name + "</span><span>" + str(price) + "</span><span> | </span><span>" + str(cal) + " cal</span></a>"
  else:
    html = "<a><span>" + name + "</span><span>$" + str(price) + "</span><span> | </span><span>" + str(cal) + " cal</span></a>"
  return html
def menu(names, prices, cals, images):
  menuHtml = "<div class='menu'>"
  for i in range(names.len()):
    menuHtml += item(names[i], prices[i], cals[i], images[i])
  menuHtml += "</div>"
  return menuHtml