Coding Tournament - Level 3
Coding Tournament - Level 3
TOURNAMENT
Level 3
]\
Import pandas as pd
Import numpy as np
6. Only files following this criteria will be graded.
1
]\
Coding Example
Write a function to check if a number is negative.
def negativeChecker(my_input):
if my_input < 0:
return True
else:
return False
2
]\
Exercise 1
Write the function in Python, called “engine”, that you have used in the
Berkshire Hathaway case study. Basically, a function that reads 3 pandas
DataFrames, and returns a single DataFrame or pandas.Series with the daily
returns of your trading strategy.
Exercise 2
Write a Python function to check if the input is a list of integers with exactly
two occurrences of nineteen and at least three occurrences of five.
Exercise 3
Write a Python function that accepts an integer, and tests whether the input
integer is greater than 4^4 and if the mod 34 is equal to 4.
3
]\
Exercise 4
Write a Python function to find the longest string of a given list of strings.
Exercise 5
Write a Python function to determine the direction ('increasing' or
'decreasing') of monotonic sequence numbers.
Example:
Input: [1, 2, 3, 4, 5, 6] -> Output: Increasing
Input: [6, 5, 4, 3, 2, 1] -> Output: Decreasing
Input: [19, 19, 5, 5, 5, 5, 5] -> Output: Not Monotonic