102k views
1 vote
What is the problem with my python code?

What is the problem with my python code?-example-1
User Pushya
by
8.0k points

2 Answers

5 votes

import math

class TripleAndHalve:

def __init__(self, number):

self.__number = number

def triple(self):

return self.__number * 3

def halve(self):

return self.__number / 2

def print_number(self):

return self.__number

t1 = TripleAndHalve(4)

print(t1.triple())

print(t1.halve())

print(t1.print_number())

User Kagronick
by
7.7k points
3 votes
Girl I don’t know figure it out
User Wakana
by
7.7k points