0 votes
0 votes
class A:

def_init__(s):  

self.s=s

def print():

pass

a = A('John')

a.print()
in Compilers, Architecture, HPC
125 views

1 Answer

0 votes
0 votes

The code you have written is erroneous.

Assuming this is the correct code:

class A:
    def __init__(self, s):  
        self.s=s
    def print(self):
        pass
a = A('John')
a.print()

Since you are invoking `a`'s print() method, which has nothing but a `pass` statement, the output will be nothing.

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true