online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#!/usr/bin/env python3 #this program convert digit to words... #run chmod +x digconv.py and then #this code can be run directly by ./digconv.py import subprocess import sys def over(): print("\n\n-----done-----") str=input("\nenter q to quit or r to restart\n") if str=="q" or str=="Q": quit() if str=="r" or str=="R": main() def nrml(num): for x in num: if(x=="0"): print ("zero",end=" ") elif(x=="1"): print("one",end=" ") elif(x=="2"): print ("two",end=" ") elif(x=="3"): print ("three",end=" ") elif(x=="4"): print ("four",end=" ") elif(x=="5"): print ("five",end=" ") elif(x=="6"): print ("six",end=" ") elif(x=="7"): print ("seven",end=" ") elif(x=="8"): print ("eight",end=" ") elif(x=="9"): print ("nine",end=" ") def convertor(num,length): if num[0]=="1": x=num[1] if(x=="0"): print ("ten",end=" ") elif(x=="1"): print("eleven",end=" ") elif(x=="2"): print ("twelve",end=" ") elif(x=="3"): print ("thirteen",end=" ") elif(x=="4"): print ("fourteen",end=" ") elif(x=="5"): print ("fifteen",end=" ") elif(x=="6"): print ("sixteen",end=" ") elif(x=="7"): print ("seventeen",end=" ") elif(x=="8"): print ("eighteen",end=" ") elif(x=="9"): print ("nineteen",end=" ") over() else: x=num[0] if(x=="0"): print (" ",end=" ") elif(x=="2"): print ("twenty",end=" ") elif(x=="3"): print ("thirty",end=" ") elif(x=="4"): print ("forty",end=" ") elif(x=="5"): print ("fifty",end=" ") elif(x=="6"): print ("sixty",end=" ") elif(x=="7"): print ("seventy",end=" ") elif(x=="8"): print ("eighty",end=" ") elif(x=="9"): print ("ninety",end=" ") x=num[1] if(x=="0"): print (" ",end=" ") elif(x=="1"): print("one",end=" ") elif(x=="2"): print ("two",end=" ") elif(x=="3"): print ("three",end=" ") elif(x=="4"): print ("four",end=" ") elif(x=="5"): print ("five",end=" ") elif(x=="6"): print ("six",end=" ") elif(x=="7"): print ("seven",end=" ") elif(x=="8"): print ("eight",end=" ") elif(x=="9"): print ("nine",end=" ") over() def main(): subprocess.call("clear") print("\n\n\n---------Digit Convertor ------(",sys.argv[0],")") num=(input("Enter the number:\n---->")) length=len(num) try: print(num[1]) except IndexError: x=num[0] if(x=="0"): print ("zero",end=" ") elif(x=="1"): print("one",end=" ") elif(x=="2"): print ("two",end=" ") elif(x=="3"): print ("three",end=" ") elif(x=="4"): print ("four",end=" ") elif(x=="5"): print ("five",end=" ") elif(x=="6"): print ("six",end=" ") elif(x=="7"): print ("seven",end=" ") elif(x=="8"): print ("eight",end=" ") elif(x=="9"): print ("nine",end=" ") over() if length>2: print("out of bound\n") print("\nprinting Normal form \n") nrml(num) print("\n\n") over() convertor(num,length) if __name__== "__main__": main()

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue