+ 6
[SOLVED] I don't understand why the print() does nothing, please, explain me:
[RESUELTO] No entiendo por qué el print() no hace nada, por favor, expliquenme: def decor(num): def printing(fun): print("***") print(f"INVOICE #{fun}") print("***") print("END OF PAGE") return printing @decor def invoice(num): print() invoice(input())
12 Respostas
+ 3
num in the decor refers to invoice function that you didn't call in the decor function
check the difference here
def decor(num):
def printing(fun):
print("***")
print(f"INVOICE-123 #{fun}")
num(fun)
print("***")
print("END OF PAGE")
return printing
@decor
def invoice(num):
print("INVOICE #" + num)
invoice(input())
+ 10
Hi â
«Caleb Guerra Ortega»â
you just need to add the print statement with output the num with statement below is your fixed code..
def decor(num):
def printing(fun):
print("***")
print(f"INVOICE #{fun}")
print("***")
print("END OF PAGE")
return printing
@decor
def invoice(num):
print("INVOICE #" +num)
invoice(input())
+ 1
Gabriel
No estoy seguro
+ 1
GAWEN STEASY
Yeah, is the same, but why in invoice function the print don't print nothing
+ 1
You might try print(" ")
+ 1
Hassan Ramos
Is same
+ 1
- 1
Hola Caleb, quizĂĄs sea el return
- 1
Hi
- 1
Any one help me to python learn
- 1
Use invoice function
- 1
Hi