A Python Interpreter
This is a simple online Python interpreter, built using the Skulpt engine (slightly modified by kwalsh).Put your Python code below (copy-and-paste or just type it in directly), then click run.
Note: this isn't a complete version of Python. See below.
Simple commands:
print ("[what you want to appear as text]")
variable = raw_input("[question to be answered in text to define a variable value, should be words]")
The variable may now be used like so:
name = raw_input("What's your name?")
print ("Hello, " + name + ".")
Or:
name = raw_input("What's your name?")
favfood = raw_input(name + ", what's your favorite food?")
You can use a variable value and divert it to separate uses:
if favfood == "Pasta": print ("Mine too!")
if favfood == "Gorgonzola": print ("No thanks!")
Have fun!
No comments:
Post a Comment