• Cursos
  • Compilador de Código
  • Discutir
  • Preços
  • Teams
Menu
+ 2

Can a class statements be run without creating its object in Python?

For example:- Class book: Print("i am in a book class") And now if i run this,it will produce an output as: I am in a book class. Why is this happening? I didn't create an object and neither i called it.Why it is so ?please explain me. Thank you in advance!!

pythonpython3pythonclasspythonobject
30th Apr 2020, 9:10 AM
Amit Pokhrel
1 Resposta
+ 3
https://www.google.com/url?sa=t&source=web&rct=j&url=https://stackoverflow.com/questions/45951535/all-statement-of-JUMP_LINK__&&__python__&&__JUMP_LINK-classes-executing-without-object-creation&ved=2ahUKEwjTxoSN6o_pAhXX6nMBHRu2CtoQFjAAegQICRAB&usg=AOvVaw1alzmz8yewxyerOQTAdejU
30th Apr 2020, 9:25 AM
minirkk
minirkk - avatar

Costuma ter perguntas como essa?

Aprenda de maneira mais eficiente, de graça:

  • Introdução ao Python

    7.1M de alunos

  • Introdução ao Java

    4.7M de alunos

  • Introdução ao C

    1.5M alunos

  • Introdução ao HTML

    7.5M alunos

Ver todos os cursos
Quente hoje
Which is easier to learn first between python and JS?
0 Votes
Does sololearn teaches on how to create games
0 Votes
Excuse me, why do they always ask us to input without telling us what it is for in python.
2 Votes
Sockets, etc
0 Votes
Quiz
0 Votes
I HAVE A PROBLEM I CANNOT ABLE TO SEND MESSAGE ANYONE AND ALSO MY MESSAGE SECTION NOT AVAILABLE "PLEASE ACTIVATE YOUR ACCOUNT
0 Votes
Necesitó ayuda
1 Votes
Any Sololearn Chat Groups that I could Join?
0 Votes
Controls issue
0 Votes
Table tags on html
0 Votes