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.
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.