ببین! چه کاریه اصلا! واه. پایتونه دیگه :دی
راه یک: بسیار ساده:
sum(n,[])
راه دوم:
import itertools
list(itertools.chain.from_iterable(n))
شاد باشی :)


On Tue, 2013-05-07 at 22:11 +0430, nima rafiee wrote:
> baraye halghe for dovomie : faramoush shode ;) 
> 
> 
> 
> 
> On Tue, May 7, 2013 at 10:00 PM, MersadKhan Mostaghimi
> <[email protected]> wrote:
> 
>         n = [[1, 2, 3], [4, 5, 6, 7, 8, 9],[10, 11]]
>         # Add your function here
>         total = []
>         def flatten(*args):
>         
>             for i in range(0,len(args)):
>                 for j in range(0,len(args[i]))
>                 total.append(args[i][j])
>             return total
>         print flatten(n)
>         
>         
 <        
 <        من این کد را نوشتم ولی جواب نمیده ؟چرا؟
 <        
>         -- 
>         MerSadKhaN
>         
>         
>         _______________________________________________
>         Py mailing list
>         [email protected]
>         http://isfahanlug.org/mailman/listinfo/py_isfahanlug.org
>         
> 
> 
> 
> 
> _______________________________________________
> Py mailing list
> [email protected]
> http://isfahanlug.org/mailman/listinfo/py_isfahanlug.org
_______________________________________________
Py mailing list
[email protected]
http://isfahanlug.org/mailman/listinfo/py_isfahanlug.org

Reply via email to