Porting an algorithm in C to Python

Raphael Ribeiro gusraan at terra.com.br
Mon Aug 26 19:49:11 EDT 2002


I couldn't port this , can someone tell me how this code would be if
it was implemented in python? Any help would be appreciated..

int main()
{
  int teste=1, n;
  while (scanf("%d", &n) == 1 && n != -1)
    printf("Teste %d\n%d\n\n", teste++, ((1 << n)+1)*((1 << n)+1));
  return 0;
}



More information about the Python-list mailing list