I have a variable "final" = lst1.append(num1) I want to print final, but when I do it prints "None", rather than the value I want.
Code:
lst1 = [1,2,3,4]
num1 = 7
final = lst1.append(num1)
print ("The value for final is",final)
Here, I want it to print "The value for final is [1,2,3,4,7]", but instead it's printing "The value for final is None." What am I doing wrong? Is the problem here, or might I be returning a value wrong elsewhere in my code? (This code is just an small example for the error).
Also, is there a way to make it so when printing final, instead of it being a list, it prints it as a string? So 12347 instead of [1,2,3,4,7]
Help is appreciated!