Question
Write a function that takes, as an argument, an object of one of the seven types of input indicated in the table below (these are
Write a function that takes, as an argument, an object of one of the seven types of input indicated in the table below (these are just examples of the type of input that this function will examine), and returns a description of the type of input, as specified in the table. Name this function whatAmI(thing).
whatAmI(23) should return "Non-Negative Integer", whatAmI("23") should return "String with Digits", whatAmI("yibbie") should return "String with letters", whatAmI(-13) should return "unidentified object", whatAmI("yib4bie") should return "unidentified object", whatAmI(23.0) should return "unidentified object", and whatAmI("23") should return "unidentified object".
If none of these apply, return the stringUnidentified object. Characters for punctuation are neither digits nor letters. They should be classified as Unidentified object at this point.
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