python - 是否有任何具有可用内置模块的在线 Python IDE?
问题描述
我找到了很多在线 Python 编辑器,但没有一个有可用的模块。math
是否有任何在线可用的 IDE 具有简单的模块,例如random
内置的?
解决方案
好吧,我没有测试任何种类的在线 python 解释器,但是一个快速的实验产生了这个网站。它可以运行您的基本甚至一些高级内置模块
测试代码如下
# Online Python compiler (interpreter) to run Python online.
# Write Python 3 code in this online editor and run it.
import random
#testing a random built-in module
marks = {
"English": random.randint(1, 100),
"Bio": random.randint(1, 100),
"Botany": random.randint(1, 100),
"Literature": random.randint(1, 100),
}
for mark in marks.keys():
print("You got ", marks[mark] , " marks in ", mark)
#testing the built-in sum function
total = sum([marks[subject] for subject in marks.keys()])
print("Total Marks", total)
输出如下
推荐阅读
- python - 如何为大型数组修复此 MemoryError
- vba - 删除 ListObject (动态表)中的所有列,除了基于其标题宏 vba 的特定列
- javascript - 通过单击任意位置删除课程
- laravel - Vee 验证自定义规则在 Laravel 中不起作用。未捕获(承诺中)错误:不存在此类验证器“xxx”
- mysql - 来自 VB.net 的变量 MySql Where 查询
- javascript - Vue.Js:列表渲染
- python - TensorFlow 分类模型返回不正确的输出形状
- laravel - Laravel:如何从自定义提供程序设置闪存数据?
- sql - 错误 3061:在 VBA 中使用 datepart() 时需要的参数 1 太少
- javascript - 为什么我的临时文件在一个 PHP 页面上被删除而不是另一个?