1. Define a function called all_integers() that takes a tuple, returns True if all the items in...
Question:
1. Define a function called all_integers() that takes a tuple, returns True if all the items in the tuple are integers*, and returns False otherwise. For example, all_integers( (3, 5, 17, 257, 65537) ), all_integers( (-1,) ), and all_integers( () ) should all return True, but all_integers( (2.0,4.0) ) and all_integers( (8, 4, \"2\", 1) ) should both return False. Your function should use a for loop or a while loop to do this calculation.
2. Define a function called half() that takes either a number or a string. If the argument is an integer, it should return half of the integer (rounded down). If the argument is a floating point number, it should return half of the argument (not rounded). If the argument is a sequence (such as a string or tuple), it should return the first half of the argument (rounding down if the string has an odd number of characters). So half(7) should return 3 (not 3.0!), half(9.0) should return 4.5,half(\"seventeen\") should return \"seve\", and half((1,2,3,4,5,6,7)) should return(1,2,3).