Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a stacktrace for this code for an upvote please quickly assignment is due soon someone answered the question but told me there was no

Create a stacktrace for this code for an upvote please quickly assignment is due soon someone answered the question but told me there was no stacktrace because code is perfect but i need a stacktrace for the errors of the startercode

starter code:

#define our bookshelf myShelf = "Little Women~An Absolutely Remarkable Thing~The Bluest Eyes~Python for Everyone~The Hunger Games~Fun Home" #Function bookCount should take a string and return the number of books on your shelf def bookCount(): #turn into list #count list return print("How many books? ", bookCount(myShelf))

code that needs stacktrace:

myShelf = "Little Women~An Absolutely Remarkable Thing~The Bluest Eyes~Python for Everyone~The Hunger Games~Fun Home" #Function bookCount should take a string and return the number of books on your shelf def bookCount(myShelf): splitText = myShelf.split("~") # split to a list using ~ as a splitting point size = len(splitText) # find out length of the list return size # return the length print("How many books? ", bookCount(myShelf))

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_2

Step: 3

blur-text-image_3

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

Databases Illuminated

Authors: Catherine M Ricardo, Susan D Urban

3rd Edition

1284056945, 9781284056945

More Books

Students also viewed these Databases questions