答案 0 :(得分:2)
您的$('video').click(function() {
if (this.paused)
{
this.play();
// remove the attr's
$(this).removeAttr('autoplay').removeAttr('loop');
}
// If first time and is not paused
else if(!this.paused)
{
this.play();
// add the attr's back
$(this).('autoplay', 'autoplay').attr('loop', 'loop');
}
});
在第10行不合适
你的代码有适当的缩进:
else indentation
这只是代码顶部的编辑。但我不会建议这种方法,因为你一次又一次地为这两个问题编写相同的代码。相反,我会建议使用一个适当的数据结构并循环,然后它将足够动态来做更多的测验。你可以像这样使用一个字典数组 -
def quiz():
score = 0
begin = raw_input("do you want to start ?")
if begin == "yes":
print "A : 56"
print "B : 48"
print "C : 45"
q1 = raw_input("what is 12*4")
if q1 in ["b","B"]:
print "congrats !! well done!1"
score += 1
else:
print "sorry!! you are wrong try next one !! good luck"
print "A : Another ice age"
print "B : A meteor will hit the earth"
print "C : Aliens will invade earth"
q2 = raw_input("what will happen in 50 years?")
if q2 in ["a","A"]:
print "nice !! keep going!1"
score += 1
else:
print "sorry!! you are wrong try next one !! good luck"
return score
else:
print "ok bye"
return 0
答案 1 :(得分:1)
我不熟悉Pythonista,但是,通过快速搜索,它使用了很大的空白区域。在这种情况下,你的else会缩进,它应该与它对应的if处于同一级别。稍后会有更多这样的错误。
请点击此处了解详情:http://omz-software.com/pythonista/docs/tutorial/controlflow.html