Skip to main content
Code Review

Return to Answer

replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

Main

You should add a main to this program (see this answer for more info see this answer for more info)

if __name__ == '__main__':
 print_pascal(10)

Your printing is a bit strange.

I would either split up print_pascal or change it further, the output as it is is awkward. I would expect:

1
1, 1
1, 2, 1

or:

1
1 1
1 2 1

etc. The [] are weird. I would either create a function pascal(n) -> [[Row]] or format the printing to omit the brackets in print_pascal. The first method gives a datatype immediately by Python. The second option is more efficient.

Main

You should add a main to this program (see this answer for more info)

if __name__ == '__main__':
 print_pascal(10)

Your printing is a bit strange.

I would either split up print_pascal or change it further, the output as it is is awkward. I would expect:

1
1, 1
1, 2, 1

or:

1
1 1
1 2 1

etc. The [] are weird. I would either create a function pascal(n) -> [[Row]] or format the printing to omit the brackets in print_pascal. The first method gives a datatype immediately by Python. The second option is more efficient.

Main

You should add a main to this program (see this answer for more info)

if __name__ == '__main__':
 print_pascal(10)

Your printing is a bit strange.

I would either split up print_pascal or change it further, the output as it is is awkward. I would expect:

1
1, 1
1, 2, 1

or:

1
1 1
1 2 1

etc. The [] are weird. I would either create a function pascal(n) -> [[Row]] or format the printing to omit the brackets in print_pascal. The first method gives a datatype immediately by Python. The second option is more efficient.

Source Link
Dair
  • 6.2k
  • 1
  • 21
  • 45

Main

You should add a main to this program (see this answer for more info)

if __name__ == '__main__':
 print_pascal(10)

Your printing is a bit strange.

I would either split up print_pascal or change it further, the output as it is is awkward. I would expect:

1
1, 1
1, 2, 1

or:

1
1 1
1 2 1

etc. The [] are weird. I would either create a function pascal(n) -> [[Row]] or format the printing to omit the brackets in print_pascal. The first method gives a datatype immediately by Python. The second option is more efficient.

lang-py

AltStyle によって変換されたページ (->オリジナル) /