【问题标题】:Are there any online Python IDE's that have the built-in modules available?是否有任何具有可用内置模块的在线 Python IDE?
【发布时间】:2021-11-09 06:18:31
【问题描述】:

我找到了很多在线 Python 编辑器,但没有一个提供任何可用的模块。网上有没有内置mathrandom等简单模块的IDE?

【问题讨论】:

标签: python python-3.x python-2.7


【解决方案1】:

好吧,我没有测试任何种类的在线 python 解释器,但是一个快速的实验产生了这个Website。它可以运行您的基本甚至一些高级内置模块

测试代码如下

# 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)

输出如下

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-14
    • 1970-01-01
    • 2017-07-29
    • 2010-09-17
    • 2021-12-29
    相关资源
    最近更新 更多