variable assignment - Python printing none -


so have assignment completed there's 1 last step print says none. here's code

#copy definition of function print_chars below def print_chars(multiples, char):     print_chars= multiples* char     print (print_chars)  #copy definition of function sum_arithmetic_seq below def sum_arithmetic_seq(n):     return n* (n+1)//2   #copy definition of function factorial below import math def factorial(n):     return math.factorial(n)  #here's program n in range(1,7,1):     print(n)     print('sum:', print_chars(sum_arithmetic_seq(n) ,'*'))     print('factorial:', print_chars(factorial(n),'#')) 

the output end (i'm going put part of because it's long.)

1 * sum: none # factorial: none  how it's supposed be: 1 sum: * factorial: # 

print_chars doesn't return anything. make return printing can use it's output. in last print, can't utilize value because there nothing there. change print return fix it.


Popular posts from this blog