Question
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
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