<jupyter_start><jupyter_text>Weekend Assignment 2 (Python Crash Course - IMSAL) 1) Ask the user to input his top 5 food. Instead of using 5 lines of input code, try to make a loop. These 5 strings should be saved in a list called food.<jupyter_code>food = []

print("Hello give me your top 5 food")
i = 0
while i < 5:
    food_ =<jupyter_output><empty_output><jupyter_text>2) Now make another loop that will check if the string "fries" is inside the list food. Don't use 'in' for this exercise, but make a while loop that will check every element and print "Yes fries is in the list" if it is. If it's not in the list your code should print nothing. (Of course go back to previous exercise and add and/or remove "fries" from the list then run your solution to this exercise again and again to test that your code works in every case) 3) Sometimes an input requires to be a number and not a string. Just think about when asking for the age or for a year of birth. However the input function automatically converts an input to a string. We've seen that we can solve this problem by using the int() function this way: int(input("Age: ")). However this wouldn't work if the user inputs a word or a text. The int() function cannot convert a word to an integer. The string has to be only composed of digits. Who guarantees that a user of your program won't input for example: "Twenty one" instead of "21"? If you would ask the input this way: int(input("Age: ")) your program would crash after the input of "Twenty one". Make a while loop in which you will ask for the age again and again and again until the given input is only composed of digits (internet research).Example:Enter your age: "Twenty One"Sorry, only numbers are allowed, enter your age: "I meant 21"Sorry, only numbers are allowed, enter your age: "21 (I hope this time it works)"Sorry, only numbers are allowed, enter your age: "21"Thank you ! 4) Below is a multi-dimensional list or a 'matrix'. This is especially useful for cases where grids are needed. Just think about how a chess board or a 2D game could be represented. In fact a matrix is nothing more than lists inside of lists. The matrix below represents a chess game at the initial state. Just like in this picture: https://www.google.com/search?client=ubuntu&hs=A0n&channel=fs&biw=1366&bih=616&tbm=isch&sxsrf=ACYBGNSRZd6qHV50g8uTt15hEEW9nijJuw%3A1568537058241&sa=1&ei=4vl9XbGsDonWkwXX_a1w&q=chess+gameimgrc=K-EUBXv4ttzzwM:Every cell is represented by an element of a sublist. For visual simplification I have left 1 sublist per line, but it doesn't matter whether you do it this way or write the lists one after each other. Just make sure to have a comma between each list.Your pieces have the number 1. Your opponent's pieces are marked by 2. So 'Q1' means your queen while 'Q2' means your opponent's queen. Here is the list of pieces:* K: A king* Q: A queen* B: A Bishop* K: A Knight* R: A Rook* P: A PawnRun the code below to save the chess_board<jupyter_code>chess_board = \
[['R2','K2', 'B2', 'Q2', 'K2', 'B2', 'K2', 'R2'],
 ['P2','P2', 'P2', 'P2', 'P2', 'P2', 'P2', 'P2'],
 ['  ','  ', '  ', '  ', '  ', '  ', '  ', '  '],
 ['  ','  ', '  ', '  ', '  ', '  ', '  ', '  '],
 ['  ','  ', '  ', '  ', '  ', '  ', '  ', '  '],
 ['  ','  ', '  ', '  ', '  ', '  ', '  ', '  '],
 ['P1','P1', 'P1', 'P1', 'P1', 'P1', 'P1', 'P1'],
 ['R1','K1', 'B1', 'Q1', 'K1', 'B1', 'K1', 'R1']]
chess_board  # Run this line to check that the chess board is correctly loaded<jupyter_output><empty_output><jupyter_text>5) It is your turn to play. You make the very classical move of moving your Pawn (P1) just above your king (K1) two cells up. How many cells should you edit ? Do it.<jupyter_code># Here make the required edits (don't forget to save these edits back in chess_board):

# Here print the resulting board:<jupyter_output><empty_output><jupyter_text>6) Your opponent is not so smart and moves his Pawn (P2) under his Queen (Q2) two cells down.<jupyter_code># Here make the required edits (don't forget to save these edits back in chess_board):

# Here print the resulting board:<jupyter_output><empty_output><jupyter_text>7) You now eat with your previously moved Pawn (P1) his moved Pawn (P2). This will require your Pawn to move diagonally one cell up to the left (and this is how Pawns eat in chess).<jupyter_code># Here make the required edits (don't forget to save these edits back in chess_board):

# Here print the resulting board:<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10454748105216229, 'fraction_numerical': 0.02229157378510923, 'mean_word_length': 4.328978622327791, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 21, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '71242', 'license': 'MIT', 'n_tokens_mistral': 1466, 'n_tokens_neox': 1389, 'n_words': 678, 'path': 'assignments/Lab3 (1&2)/.ipynb_checkpoints/Weekend Assignment 2-checkpoint.ipynb', 'repo_name': 'Adam1023/Python-Crash-Course', 'size': '4486'}