Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribeddef 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro SQL Server Wait Statistics

Authors: Enrico Van De Laar

1st Edition

1484211391, 9781484211397

More Books

Students also viewed these Databases questions