Beginner problem

Hello everyone,

I’m beginning with dynamo script. I dont know Python so I asked my friend for help. He writed some simple code for me, but he doesnt know Dynamo nor Revit. So, can I ask you for a help with input thos to Python Script node in Dynamo? I need some information and tips what is important to avoid mistakes in the future :wink:

This is what I have now:

#!/bin/env python

-- coding: utf-8 --

a = [‘A5’, ‘A8’, ‘A3’, ‘A1’, ‘A2’]
b = [5, 8, 3, 1, 2]
c = sorted(b)

def isort(a, b, c):
d = []
ll = range(len(a))
for i in ll:
swap = False
for j in ll:
if c[i] == b[j]:
d.append(a[j])
swap = True
if not swap:
d.append(0)
return d

print(f’a = {a}’)
print(f’b = {b}’)
print(f’c = {c}’)
print(f’d = {isort(a, b, c)}’)

I want 3 lists (a, b and c) as input and list d as output. Could you correct this code and make it right for Dynamo?

Thank you in advance :wink:
I count on yours understanding

http://dynamoprimer.com/en/09_Custom-Nodes/9-4_Python.html

Problem solved. Thank you