mardi 5 mars 2019

What is the logic behind to print the following pattern and please write the code also?

The interviewer asked me to print the following pattern in python

    1
   12
  121
12123

and I was confounded so I said "No, I don't know how to do this?" he said "Out of nervousness," I said, "No because I am not getting the logic". Then he gave the

Hint: think about odd and even position columns-wise. Help me out please.

Aucun commentaire:

Enregistrer un commentaire