# Convert integers to list?

**URL:** <https://community.wolfram.com/t/convert-integers-to-list/13243>\
**Category:** Questions\
**Created:** [October 26, 2018, 9:10pm UTC](https://community.wolfram.com/t/convert-integers-to-list/13243 "2018-10-26T21:10:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![oganozturk](https://avatars.discourse-cdn.com/v4/letter/o/4af34b/32.png) [@oganozturk](https://community.wolfram.com/u/oganozturk)\
**Post date:** [October 26, 2018, 9:10pm UTC](https://community.wolfram.com/t/convert-integers-to-list/13243/1 "2018-10-26T21:10:43Z")

</div>

I’m trying to get a list output, but I get integer results.

Is there a way to convert integers to list?

Here is my code:

```
list = {12, 37, 44, 96};
    list2 = IntegerDigits[list];
    Do[
     list3 = Total[list2[[i]]];
     Print[list3];
     , {i, 1, Length[list]}]

```

---

<div class="post-metadata">

**Author:** ![henrikschachner](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/henrikschachner/32/32119_2.png) [@henrikschachner](https://community.wolfram.com/u/henrikschachner)\
**Post date:** [October 26, 2018, 9:52pm UTC](https://community.wolfram.com/t/convert-integers-to-list/13243/2 "2018-10-26T21:52:05Z")

</div>

Do you mean this?

```
list3 = Total /@ list2

```

---

<div class="post-metadata">

**Author:** ![oganozturk](https://avatars.discourse-cdn.com/v4/letter/o/4af34b/32.png) [@oganozturk](https://community.wolfram.com/u/oganozturk)\
**Post date:** [October 26, 2018, 9:55pm UTC](https://community.wolfram.com/t/convert-integers-to-list/13243/3 "2018-10-26T21:55:37Z")

</div>

Yes, I meant that, thank you.

---

<div class="post-metadata">

**Author:** ![mariuszi28cg](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/mariuszi28cg/32/308_2.png) [@mariuszi28cg](https://community.wolfram.com/u/mariuszi28cg)\
**Post date:** [October 26, 2018, 10:15pm UTC](https://community.wolfram.com/t/convert-integers-to-list/13243/4 "2018-10-26T22:15:26Z")

</div>

You can find this trick in Documentation of **Do**.

```
list = {12, 37, 44, 96};
list2 = IntegerDigits[list];
Reap[Do[list3 = Total[list2[[i]]];
   Sow[list3];, {i, 1, Length[list]}]][[2, 1]]

(* {3, 10, 8, 15} *)

list = {12, 37, 44, 96};
list2 = IntegerDigits[list];
t = {}; Do[list3 = Total[list2[[i]]];
 AppendTo[t, list3];, {i, 1, Length[list]}]; t

(* {3, 10, 8, 15} *)

```

---

<div class="post-metadata">

**Author:** ![oganozturk](https://avatars.discourse-cdn.com/v4/letter/o/4af34b/32.png) [@oganozturk](https://community.wolfram.com/u/oganozturk)\
**Post date:** [October 26, 2018, 10:27pm UTC](https://community.wolfram.com/t/convert-integers-to-list/13243/5 "2018-10-26T22:27:26Z")

</div>

Thank you Mariusz, This trick helped.
