Before the name change in the year 2022, Toronto Metropolitan University was known as Ryerson University. Given the percentage grade, calculate and...
Read moreDetermine whether the sequence of items is strictly ascending so that each element is strictly larger (not just merely equal to) than the...
Read moreGiven a list of items whose length is guaranteed to be even (note that “oddly” enough, zero is an even number), create and return a list produced by p...
Read moreCheck that the given positive integer n contains only odd digits (1, 3, 5, 7 and 9) when it is written out. Return True
if this is the case, and `Fa...
A nonnegative integer is said to be a cyclops number if it consists of an odd number of digits so that the middle (more poetically, the “eye”) digit i...
Read moreA single domino tile is represented as a two-tuple of its pip values, such as (2,5) or (6,6). This function should determine whether the given list of...
Read moreThis problem was inspired by the Mathologer video “Secret of Row 10”
. To start, assume the existence of three values called “red”, “yellow” and “blu...
An element in a list of items is a dominator if every element to its right (not just the one element immediately to its right, but all of them) is...
Read moreGiven a string of digits guaranteed to only contain ordinary integer digit characters 0 to 9, create and return the list of increasing integers acquir...
Read moreWrite a function that takes a parameter and returns the type of the variable as a string. The function should accept one parameter and return a string...
Read moreWrite a function that takes two parameters: a value and a type to cast to. The function should cast the input value to the specified type and return t...
Read moreWrite a function that takes an integer and returns "Even"
if the number is even, or "Odd"
if the number is odd. This problem is `designed to help...
Write a function that takes two numbers and returns a string indicating their comparison result. The function should accept two parameters and return:...
Read moreWrite a function that takes a string and a position (index) and returns the character at that position in the string. This problem is `designed to hel...
Read moreWrite a function that takes a string and returns the string reversed. This problem is designed to help you practice string manipulation and slicing
....
Write a function that takes two strings and returns True
if the second string is a substring of the first string, or False
otherwise. This problem...
Write a function that takes two strings and returns a new string that is the concatenation of the two input strings. This problem is `designed to help...
Read moreWrite a function that takes a context string and a value, and returns a formatted string combining both. This problem is `designed to help you practic...
Read moreWrite a function that takes a list of numbers and returns the sum of all the elements. This problem is `designed to help you practice working with lis...
Read moreWrite a function that takes a list of numbers and returns the largest element. This problem is `designed to help you practice working with lists and f...
Read moreWrite a function that takes a list and returns a new list with the elements in reverse order. This problem is `designed to help you practice working w...
Read moreWrite a function that takes a list of numbers and returns a new list with the elements sorted in ascending order. This problem is `designed to help yo...
Read moreWrite a function that takes a list and a value, and returns a new list with all occurrences of the specified value removed. This problem is `designed...
Read moreWrite a function that takes two lists and returns a new list that is the concatenation of the two input lists. This problem is `designed to help you p...
Read moreWrite a function that takes a list and a value, and returns True
if the value is in the list, or False
otherwise. This problem is `designed to hel...
Write a function that takes a dictionary and a key, and returns the value associated with the key. This problem is `designed to help you practice acce...
Read moreWrite a function that takes a dictionary, a key, and a value, and returns a new dictionary with the key-value pair added. This problem is `designed to...
Read moreWrite a function that takes a dictionary and a key, and returns a new dictionary with the specified key removed. This problem is `designed to help you...
Read moreWrite a function that takes a positive integer N and returns a list of numbers from N down to 1. This problem is `designed to help you practice loopin...
Read moreWrite a function that takes a start number, an end number, and a step size, and returns a list of numbers starting from the start number up to but not...
Read moreWrite a function that takes two integers, start and end, and returns a list of all even numbers between start and end (inclusive). This problem is `de...
Read moreWrite a function that takes a positive integer N and returns its factorial calculated using a for loop. This problem is `designed to help you practice...
Read moreWrite a function that takes a positive integer N and returns the sum of all numbers from 1 to N using a while loop. This problem is `designed to help...
Read moreWrite a function that takes a positive integer N and returns its reverse using a while loop. This problem is `designed to help you practice using whil...
Read moreWrite a function that takes a positive integer N and returns a list containing the Fibonacci sequence up to N terms using a while loop. This problem i...
Read moreWrite a function that takes a positive integer N and returns the number of digits it contains using a while loop. This problem is `designed to help yo...
Read moreWrite a function that takes two integers: start
and an end
(interval definition, exclusive) and returns all identified prime numbers
in a list
...
Write a function that takes two parameters: a list of integers
and an integer
exponent. The objective is to return a list of integers
where each...
Implement a primitive calculator that accepts some operation code
with two parameters operand1
and operand2
. This problem is `designed to help...
Write a function that takes a list of words and identifies which words are palindromes. This problem is `designed to help you practice creating and ca...
Read moreWrite a function that takes a birthdate as a string in the format "YYYY-MM-DD" and returns the age in years as an integer. This problem is `designed t...
Read moreWrite a function that takes a date string in the format "YYYY-MM-DD" and an integer number of days to add. The function should return a new date strin...
Read moreWrite a function that takes two date strings in the format "YYYY-MM-DD" and returns the number of days between them as an integer. This problem is `de...
Read moreWrite a function that takes a time string in the format "HH:MM:SS" and returns it in 12-hour format with AM/PM. This problem is `designed to help you...
Read moreWrite a function that takes a year as an integer and returns True
if it is a leap year, or False
otherwise. This problem is `designed to help you...
Write a function that takes two numbers and returns the minimum of the two using built-in functions. This problem is `designed to help you practice us...
Read moreWrite a function that takes two numbers and returns the maximum of the two using built-in functions. This problem is `designed to help you practice us...
Read moreWrite a function that takes two numbers, base and exponent, and returns the result of raising the base to the power of the exponent using built-in fun...
Read moreWrite a function that takes a number and returns its absolute value using built-in functions. This problem is `designed to help you practice using bui...
Read more