喜有誰能夠告訴我,我怎麼能檢查變量值在數組或不 像我有檢查變量值在數組或不Django的
variable = 17.40
array = [14.40,14.12,45.50.....]
需要檢查變量的值存在或不存在
編輯 我有嘗試以下方法,但它亙古不變的工作
scoremx = [19,18,17]
style_score=score.objects.get(user_id=request.user.id)
if style_score.style_quiz_score in scoremx:
it goes in else cxondition but it has the 19 value in database
'style_quiz_score'是一個整數嗎? – Zulu 2013-02-21 11:19:36
包含float和int值 – 2013-02-21 11:20:10