Question: Task 3 [ 1 0 points ] Function splithalines ( ) processes the booking lines into booking parts. Strip each line of the ' :

Task 3[10 points]
Function splithalines () processes the booking lines into booking parts. Strip each line of the ':'
characters, convert its number substrings into integers, and return a 2D list where each item list
contains the parts for one booking.
The parts at indices 1,2,4, and 5 in a booking list are integers. Also, parts at index 7 or higher are
integers. If any substrings cannot be converted into an integer, your function should return an error
message as shown below.
Signature: shlit lines(bookinglines)
bokkingalioes, is a list containing booking lines represented as strings
The return value is a 2D list where each item list contains the parts of a booking. If a substring
could not be converted, return the string "An int was expected instead of
Task 3 [ 1 0 points ] Function splithalines ( )

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!