小编Ros*_*son的帖子

是或否输出Python

Join = input('Would you like to join me?')
if Join == 'yes' or 'Yes':
  print("Great," + myName + '!')
else:
  print ("Sorry for asking...")
Run Code Online (Sandbox Code Playgroud)

所以这是我的代码.它更长; 只是包括问题.我问一个是或否的问题,在控制台中它运行顺利直到你到达它.无论你输入什么,你都会得到'是'的输出.有人可以帮忙吗?我也使用过elif语句,但没有运气.

python variables

2
推荐指数
1
解决办法
4万
查看次数

jQuery/JavaScript无法在脚本标记内工作

我想,我的HTML文档输出龙与地下城的随机数.但是,代码不起作用,我无法锻炼为什么.

<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-1.10.2.js">
$(document).ready(function(){
  $("#d4").click(function(){
    var out = Math.random(1,4);
    alert(out);
  };
});
</script>
</head>
<body>
  <p id ="d4">Roll a d4</p>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

html javascript jquery

1
推荐指数
1
解决办法
5042
查看次数

标签 统计

html ×1

javascript ×1

jquery ×1

python ×1

variables ×1