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

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 Databases Questions!