online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
import copy class TOTO: @staticmethod def value_exchange1(tipp1, tipp2): """A tipp1 lista elemeit 0 indextől kezdődően lecseréli a tipp2 lista nem nullás elemeivel. Minden egyes elem csere új tippsort hoz létre.""" i = 0 column_number = 0 while i < len(tipp1): # Ha nem '0' az elem if tipp2[i] != "0": # A tipp1 listában egy elem csere tipp1[i] = tipp2[i] # A felhasznált elemet nullázza tipp2-ben. tipp2[i] = "0" # Eggyel több oszlop beállítás column_number += 1 print('Tipposzlop', column_number, tipp1) i += 1 @staticmethod def value_exchange2(tipp1, tipp2): """A tipp1 lista csak egy elemét változtatja meg ciklusban (loop). A következő elem változásához az eredeti változás mentes tipp1 sort használja Minden egy elem cseréje új tippsort hoz létre.""" column_number = 4 for index, elem in enumerate(tipp2): # Ciklusonkénti mélymásolás a new_list -hez. new_list = copy.deepcopy(tipp1) # A mélymásolt lista egy elemét cseréli if elem != '0': new_list[index] = tipp2[index] # Eggyel több oszlop beállítás column_number += 1 print('Tipposzlop', column_number, new_list) if __name__ == "__main__": lista1 = ['1', '1', '1', 'x', 'x', 'x', '1', '1', '1', 'x', 'x', 'x', 'x'] lista2 = ['2', '0', 'x', '0', '0', '0', '0', '0', '0', '0', '0', '1', '2'] new_list1 = copy.deepcopy(lista1) new_list2 = copy.deepcopy(lista2) print('Fő oszlop 0', lista1) app = TOTO() app.value_exchange1(lista1, lista2) app.value_exchange2(new_list1, new_list2)

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