Mango Python IDE

Drag and drop the code elements into the editor

Input and Output

print(" ")
answer = input()
number = int(input())
number = float(input())

Casting

number = int()
string = str()
decimal = float()
Variables

number_variable = 1
string_variable = ""
boolean_true = True
boolean_false= False
join_string = "Hello" + "World"

Arithmetic Operators

add = a + b
subtract = a - b
divide = a / b
multiply = a * b
integer_division = a // b
remainder = a % b

Relational Operators

boolean = a > b
boolean = a < b
boolean = a >= b
boolean = a <= b
boolean = a == b
boolean = a != b

Logical Operators

expression1 and expression2
expression1 or expression2
not expression

Lists

empty_list = []
items_list = [1,2,"a","b"]
list_2D = [[1,2],["a","b"]]
access_element = items[2]

Selection

if condition:
	
if condition:
	
else:
	
if condition:
	
elif condition:
	
else:
	

Iteration

for i in "string":
	
for i in list_of_items:
	
for i in range():
	
while True:
	

Random

import random
randval = random.randint(1,10)
item = random.choice(itemList)

Subroutines

def procedure():
	
procedure()
def procedure(param,..):
	
procedure(param,..)
def function(param,..):
	
	return
function(param,..)