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')
]
寶之間缺少昏迷對象 –