id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

amgreyson@gmail.com > whatTypeTwoLists
prev  |  next  |  chance

Given a rational number as input, name the set or sets to which it belongs: natural, whole, integer, and/or rational. For example, 3 would be a member of the natural, whole, integer, and rational sets; whereas -3.5 would be a member of the rational set, only. Return one of the following four options as your result: ['natural', 'whole', 'integer', 'rational'], ['whole', 'integer', 'rational'], ['integer', 'rational'], or ['rational'].


whatTypeTwoLists(6.5) → ['rational']
whatTypeTwoLists(-1) → ['integer', 'rational']
whatTypeTwoLists(0) → ['whole', 'integer', 'rational']

...Save, Compile, Run (ctrl-enter)

def whatTypeTwoLists(aRationalNumber):

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help

Difficulty: 175 Post-solution available

Copyright Nick Parlante 2017 - privacy