This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
PYTHON 3 | |
Coding challenges | loops | |
""" | |
""" | |
CODE CHALLENGE: LOOPS | |
Divisible by Ten | |
divisible_by_ten(nums) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Carly's Clippers | |
You are the Data Analyst at Carly’s Clippers, the newest hair salon on the block. Your job is to go through the lists of data that have been collected in the past couple of weeks. You will be calculating some important metrics that Carly can use to plan out the operation of the business for the rest of the month. | |
You have been provided with three lists: | |
hairstyles: the names of the cuts offered at Carly’s Clippers | |
prices: the price of each hairstyle in the hairstyles list | |
last_week: the number of each hairstyle in hairstyles that was purchased last week | |
Let’s get started! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Create a function named lots_of_math(). This function should have four parameters named a, b, c, and d. The function should print 3 lines and return 1 value. | |
First, the sum of a and b. | |
Second, d subtracted from c. | |
Third, the first number printed, multiplied by the second number printed. | |
Finally, it should return the third number printed mod a. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Create a function called every_three_nums that has one parameter named start. | |
The function should return a list of every third number between start and 100 (inclusive). | |
For example, every_three_nums(91) should return the list [91, 94, 97, 100]. | |
If start is greater than 100, the function should return an empty list. | |
""" | |
#Write your function here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Create a function named same_name() that has two parameters named your_name and my_name. | |
If our names are identical, return True. Otherwise, return False. | |
""" | |
# Write your same_name function here: | |
def same_name(your_name, my_name): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(void) | |
{ | |
int age = 15; | |
(age == 15) ? printf("You're 15 years old. \n") : printf("You're not 15 years old.\n"); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Write a function called unique_english_letters that takes the string word as a parameter. | |
The function should return the total number of unique letters in the string. | |
Uppercase and lowercase letters should be counted as different letters. | |
We’ve given you a list of every uppercase and lower case letter in the English alphabet. | |
It will be helpful to include that list in your function. | |
""" |