dimanche 23 avril 2017

how to insert numbers in a list c++ style using python [duplicate]

This question already has an answer here:

i have this c++ code.

        int range = 0;

        cin>>range;

        int input[range] = {0};

    //      inserting in array
        for(int i=0; i<range;i++)
        {
            cin >>input[i];
        }

    //  Printing out from array
        for(int i=0; i<range;i++)
        {
            cout<<input[i];
        }

i am wondering how to write this piece of code in python which does the same thing. i am a beginner in python so i haven't tried much things out yet.

Aucun commentaire:

Enregistrer un commentaire