1
Python/Django newcomer here。我得到一个语法错误,下面的代码,任何人都可以帮我在这里? IDLE3之前突出显示了16号线“宝物”(“愚人金牌”)。无效的语法错误 - Python 3.5.2 Django 1.10
from django.shortcuts import render
# Create your views here.
def index(request):
return render(request, 'index.html', {'treasures':treasures})
class Treasure:
def __init__(self, name, value, material, location):
self.name = name
self.value = value
self.material = material
self.location = location
treasures = [
Treasure('Gold Nugget', 500.00, 'gold', "Curley's Creek, NM")
Treasure("Fool's Gold", 0, 'pyrite', "Fool's Falls, CO")
Treasure('Coffee Can', 20.00, 'tin', 'Acme, CA')
]
宝之间缺少昏迷对象 –