[SOLVED] How to convert python to Pseudocode?

Issue

This Content is from Stack Overflow. Question asked by willbsupreme

I am learning how to use Pseudocode and have made a randomly generated 10 x 10 grid in python. I am trying to convert my python script into Pseudocode. Any suggestions?, Thanks

int main(void)
{
  int i = 0;
  while (i <= 99)
  {
    printf("%02d ", i);
    
    i++;

    if (i % 10 == 0) printf("n");
  }

  return 0;
}

 



Solution

Pseudocode is a loose definition for code that is colloquially understood for roughly sketching an algorithm. The Pseudocode is express by relying on common concepts such as if,for,while and return.

Firstly the code snippet you provided does not seem to adhere to Python syntax (since it uses braces).

Secondly the snippet could be pseudocode, except for the "printf" statement which seems language specific and usually is just referred to as "print" in Pseudocode. But generally there is no right or wrong.


This Question was asked in StackOverflow by willbsupreme and Answered by Headz0r It is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?