<jupyter_start><jupyter_text>Control Structures  Question A word is said to belong to the red team if it has the letter r in it.Write an 'if' statement to check whether the given word belongs to the red team or not.<jupyter_code># write code here<jupyter_output>Enter a word in small caps real
The word belongs to red team<jupyter_text>Question In continuation to previous example, if the word has the letter 'b', it belongs to the blue team. And if the word has both 'r' and 'b' then first letter gets a precedence. And if the word does not have the letter 'r' or 'b', it does not belong to any team. Example: (word,output)                *   rabbit = red team*   brand =  blue team*   dog   =  no teamWrite a condition for this decision.<jupyter_code># write code here 

# you might want to consider if statement inside a for loop<jupyter_output>Enter a word in small caps break
The word belongs to blue team<jupyter_text>Question Write a program to print all the numbers which are divisible by 17 between 1 and a given number 'n'.<jupyter_code><jupyter_output>Enter the upper limit 100
17
34
51
68
85<jupyter_text>QuestionWrite a program to add 13 to all the elements of a given numeric list. Example - * Input list = [1,5,27] * Output list = [14,18,40]<jupyter_code>sample_list = [6, 98, 34, 45, 64, 7, 2, 5, 78, 90, 324, 111, 657, 438]

# Write solution code here<jupyter_output>[19, 111, 47, 58, 77, 20, 15, 18, 91, 103, 337, 124, 670, 451]<jupyter_text>QuestionIn continuation to the example above, execute the same operation on the same sample list using list comprihension.<jupyter_code><jupyter_output><empty_output><jupyter_text>Question This question has two tasks:* Task 1 - Find the factors of all the numbers in a given list. * Task 2 - Add the numbers and their factors to a dictionary where the key will be the numbers from the list, and the values will be the factors of the respective number. Example -  Sample output :{6: [1, 2, 3, 6],98: [1, 2, 7, 14, 49, 98], 34: [1, 2, 17, 34],}<jupyter_code>sample_list = [6, 98, 34, 45, 64, 7, 2, 5, 78, 90, 324, 111, 657, 438]

# write code here<jupyter_output><empty_output><jupyter_text>Question Count the total number of unique characters in a given sentence. Example - * Input - 'total'* Output  - 'o', 'a', 'l'<jupyter_code>sample_sentence = "Pack my box with five dozen liquor jugs"
 
# write code here<jupyter_output>{'c', 'n', 'e', 'x', 'i', 'k', 'u', 'l', 'h', 'd', 'q', 't', 'b', ' ', 'y', 'f', 'o', 's', 'r', 'g', 'm', 'P', 'v', 'w', 'a', 'j', 'z'}<jupyter_text>Question Write a calculator application using functions, which will ask for the users input such as - arithmetic operation, number1, number 2, and return the output post applying the arithmetic operatorExample - ```def calc(operation, x,y):    if operation == "add":        return x+y```<jupyter_code># use functions to write this code<jupyter_output><empty_output><jupyter_text>Question Write a code to ask the user to input three numbers and then print the largest one among the three.<jupyter_code># You might want to use nested if statements<jupyter_output>Enter three numbers :54 25 65
54 25 65
The largest number is  65<jupyter_text>QuestionCheck whether a number is perfect or not. A perfect number is a number that is sum of all of its positive divisors (excluding itself).For more info refer to this link - https://www.geeksforgeeks.org/perfect-number/<jupyter_code><jupyter_output>Enter the number you want to check: 28
The number is a perfect number<jupyter_text>Question Add the elements in the two given lists using map and lambda functions<jupyter_code>list1 = [5, 8, 9, 12]
list2 = [10, 12, 8, 6]

# write code here<jupyter_output><empty_output><jupyter_text>Question Write a code to find the factorial of a number using reduce function. Example - 5!= 5 * 4 * 3 * 2 * 1=120.<jupyter_code><jupyter_output>Enter a natural number 5
{'fraction_non_alphanumeric': 0.09932920536635707, 'fraction_numerical': 0.047729618163054696, 'mean_word_length': 4.701470588235294, 'pattern_counts': {'":': 1, '<': 41, '<?xml version=': 0, '>': 41, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '12', 'dir': 'jupyter-structured-clean-dedup', 'id': '523404', 'license': 'MIT', 'n_tokens_mistral': 1388, 'n_tokens_neox': 1214, 'n_words': 561, 'path': 'Course_1-PreLaunch_Preparatory_Content/Module_1-Introduction_to_Python_Programming/3-Control_Structures_and_Functions/Control_Structures_and_Functions_Questions.ipynb', 'repo_name': 'Mathews-Tom/MSc_in_Machine_Learning_and_Artificial_Intelligence', 'size': '3876'}