Create List by Repeating Element

Dear Experts,
Can some one explain how we can do task listed below:
Short Expalanation. We have two input.

  1. Input 1: Text
  2. Input 2: Count
    As a result we want to create list repeating same text (Input 1) at the count of Input 2.

Repeated List.dyn (3.7 KB)

1 Like

2 Likes

@sovitek ,

is there no shorthand in design script…? i think python it is pretty smart :slight_smile:

OUT = ["A"]*5

1 Like

Nice one…what do you mean by shorthand…you had already done it in ds in your codeblock…dont think it can be done shorter in ds :wink:

1 Like

@sovitek ,

f.e. double to string is just CODEBLOCK: x+""

i can not use ["A"]*5 #thats realy short but no available in DesignScript

shorthand i mean code-comprehantions like x == true ? true : false

aha…not as far i know :wink:

Capture d’écran 2022-07-04 181748
Hello, unsuspected resources in the document of Mr. Sol Amour

Cordially
christian.stan

4 Likes

Great seems to be a lot of option here :wink:

1 Like

@christian.stan ,

thats pretty cool, so you could also connect it with a count value…! thanks for the idea.

2 Likes

Thats great…but think that way it only accept single number or letter

3 Likes

@sovitek ,

Oh no! i have to be carefull with beeing happy with dynamo or Revit :slight_smile:

1 Like

heheh :wink:

For the record :slight_smile:

4 Likes