python - why is print(type(print("888"))) of type None? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

python - why is print(type(print("888"))) of type None?

print(type(print("888"))) #outputs: 888 <class 'NoneType'> How come the inner print("888") is of type None instead of type str?

26th Sep 2020, 8:58 PM
Solus
Solus - avatar
2 Answers
+ 3
Solus , because print function doesn't return anything => None.
26th Sep 2020, 9:06 PM
TheWh¡teCat 🇧🇬
TheWh¡teCat 🇧🇬 - avatar
+ 1
try print(type("888"))
26th Sep 2020, 11:53 PM
Roderick Davis
Roderick Davis - avatar