+ 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())

30th Oct 2021, 6:56 PM
CGO!
CGO! - avatar
12 odpowiedzi
+ 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())
31st Oct 2021, 3:14 AM
Krishnam Raju M
Krishnam Raju M - avatar
+ 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())
30th Oct 2021, 7:15 PM
GAWEN STEASY
GAWEN STEASY - avatar
+ 1
Gabriel No estoy seguro
30th Oct 2021, 6:58 PM
CGO!
CGO! - avatar
+ 1
GAWEN STEASY Yeah, is the same, but why in invoice function the print don't print nothing
30th Oct 2021, 8:49 PM
CGO!
CGO! - avatar
+ 1
You might try print(" ")
31st Oct 2021, 12:20 AM
Hassan Ramos
Hassan Ramos - avatar
+ 1
Hassan Ramos Is same
31st Oct 2021, 12:22 AM
CGO!
CGO! - avatar
+ 1
Krishnam Raju M Thank you GAWEN STEASY Hassan Ramos Thanks to all
31st Oct 2021, 4:03 PM
CGO!
CGO! - avatar
- 1
Hola Caleb, quizás sea el return
30th Oct 2021, 6:57 PM
Gabriel
Gabriel - avatar
- 1
Hi
31st Oct 2021, 3:38 PM
sun tamang
sun tamang - avatar
- 1
Any one help me to python learn
31st Oct 2021, 3:39 PM
sun tamang
sun tamang - avatar
- 1
Use invoice function
1st Nov 2021, 5:26 AM
prince mujahid
- 1
Hi
1st Nov 2021, 5:27 PM
Zoyidjon Nasretdinov
Zoyidjon Nasretdinov - avatar