Question
How to fix this python program def tens(number): tens_list = ['','','twenty','thirty','fourty','fifty','sixty','seventy','eighty','ninty'] return tens_list[number] def tens_10(number): tens_10_list = ['ten','eleven','twelve','thirteen','fourteen','fifteen','sixteen','seventeen','eighteen','ninteen'] return tens_10_list[number] def ones(number): ones_list = ['','one','two','three','four','five','six','seven','eighth','nine']
How to fix this python program
def tens(number): tens_list = ['','','twenty','thirty','fourty','fifty','sixty','seventy','eighty','ninty'] return tens_list[number] def tens_10(number): tens_10_list = ['ten','eleven','twelve','thirteen','fourteen','fifteen','sixteen','seventeen','eighteen','ninteen'] return tens_10_list[number]
def ones(number): ones_list = ['','one','two','three','four','five','six','seven','eighth','nine'] return ones_list[number]
def main(): s = '' num = input('Enter the number: ') if (int(num) == 1000): s = 'one thousand' else: if (len(num) == 3): s += ones(int(num[0])) + ' hundred' if (int(num[-2:]) >= 10 and int(num[-2:])
how can you fix this python program?
def tens (number): tens-list -','','twenty' ,' thirty',' fourty','fifty',' sixty', 'seventy', 'eighty', 'ninty'] return tens_list[number] def tens_10 (number): tens-10-list = ['ten', 'eleven', 'twelve',' thirteen',' fourteen', 'fifteen',' sixteen', 'seventeen', 'eighteen', 'ninteen'] return tens_10_list[number] def ones (number): ones-list = [ ", ' one' ,' two' , return ones_list[number] three' ,' four ' , ' five' ,' six ' ,' seven' ,' eighth' , ' nine' ] def main): ') num input(' Enter the number: if (int (num) == 1000): s = 'one thousand' if (len(num) 3): if (int(num-2:J) )s 10 and int (num[-2:J) else: s += ones(int (num[0])) + hundred. s+ tens_1e (int (num -1) if (int(num[-2]) !0) s += ' ' + ones(int(num[-1]))Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started