Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please use python and show test cases. 3. Function One: whatTypes Specification The first function you will write should be called 'whatTypea. Your function should

please use python and show test cases. image text in transcribed

3. Function One: whatTypes Specification The first function you will write should be called 'whatTypea". Your function should take one (1) argument, a list. The function should return one (1) list containing the data types of each of the members of the list passed to the function. To obtain the data type, use the built-in type function discussed in class. Your return list should contain the entire output of the type function for each element. For example if you call: type('a'), you will receive as output. This is what you would place in your list. Make sure to maintain the proper ordering, so that the zeroth element of your return list corresponds to the zeroth element of the input list, etc. Page 2 of 3 Yesterday, 9:20:18 PM CS 105-Intro to Computing Non-Tech Spring 2018 est what Types(['a'. 2, 4.3] returns cclass str'>, cclass 'int'>,1 4. Function Two: cardType Spacfication The second function you will write should be caled 'cardType'. Your function should take one (1) argument, an integer representing a card type. The function should return one (1) string. The return string should contain one of three possible values: Visa, Mastercard. 'Discover Card. The value should be determined according to the following rules. Credit card numbers follow a standard system. For example, Visa, MasterCard, and Discover Card all have 16 digits, and the first digit serves to indicate the card brand. All Visa cards start with a 4; MasterCard cards always starts with a 5, and Discover cards start with a 6. For this lab, you may assume your function will only be passed a 4, 5, or 6 Testing: Create your own test cases

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

Step: 3

blur-text-image

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

Beginning C# 2005 Databases

Authors: Karli Watson

1st Edition

0470044063, 978-0470044063

More Books

Students also viewed these Databases questions