Docsity

quizz, Apuntes de Idioma Inglés

Vista previa parcial del texto

¡Descarga quizz y más Apuntes en PDF de Idioma Inglés solo en Docsity!

LINGUÚÍSTICA COMPUTACIONAL Y DE CORPUS (LENGUA INGLESA) (Clases teóricas y/o prácticas) (Grupo A) You are logged in as YI WEN (Logout) MiCampus » 12-230589 » Quizzes » Quizz 2 » Attempt 1 Quizz 2 1 : . : What does it mean to write and run a Python script: Marks: 10 Choose one answer. (a) a. to interact directly with the Python programming language O b. to open a new file, type in some Python statements, save it and run it (8) c. to open a file from a local disk and call it from Python (O d. None of the above 2 : What does the “Y' character mean in Python? Marks: 10 Choose one answer. O a. it's a character delimiter (8) b. it's a symbol to interpret the next character as a real genuine character (a) c. it indicates the beginning of a new line (Dd. None of the above 3 Indicate whether the following statements are true or false: Marks: 10 - 11 want to have double quotes in the string 1 use the single quotes as delimiters. - 1f 1 want to have single quotes in the string 1 use double quotes as delimiters Answer: O True O False 4 : : oa ”; What will happen if I type print "Jean in Hawkman” in Python? Marks: 10 Choose one answer. (3) a. The string “Jean” will appear in one line and "Hawkman” in the following line (3) b. Python will print the string "Jean Hawkman” into one single line (5) c. I will get an error message (O d. None of the above 5 What type of data tvpe is the following: [ ['the', 'dog'], 'saw', ['the', 'cat']'at', 6, 30] Marks: 10 Choose one answer. O a. a list containing lists, strings and numbers a) b. a string containing letters and numbers (3) c. a variable referring to a list of elements (O d. None of the above 6 : : . Which of the following variable names are NOT allowed? Marks: 10 Choose at least one [El a. 2ndtest answer. El — b. John's Phonenumber lc. _NounPhrase [El d. Part_of_Speech 7 Let's say you have the following list: Marks: 10 members = ['Ann', 'Ben', "Clara", "Polly", 'Sally"] What would you write in order to assign the name *head' to the first element in this list? Choose one answer. (5) a. head = list [1] (5) b. list = head [0:1] o c. head = members[0] (3) d. None of the above 8 What would you write in order to assign the name 'tail” to the members list minus the first element: Marks: 10 Choose one answer. (5) a. tail = computerists[1:] O b. tail = members[1:] O c. list = tail[1:] (5) d. None of the above 9 What would you write in order to find the length of the tail list: Marks: 10 Choose one answer. (3) a. set(tail) O b. len(tail) a) c. len(members) (a) d. None of the above 10 What would you write in order to add 'Ann' and *Ben” to the beginning of the tail list Marks: 10 Choose one answer. O a. members = ['Ann”, 'Ben'] Ob. tail ='Ann'+ 'Ben' + tail (3) c. tail = ['Ann', 'Ben'] + tail (O d. None of the above 1i What would you write in order to make a new list that contains the first element of the members list: Marks: 10 Choose one answer. (a) a. newlist = members[1:] (3) b. Members[:1] O c. members [1] (Dd. None of the above 12 What would you write in order to make a new list that contains everything but the first 2 elements of members: Marks: 10 Choose one answer. (3) a. members[:2] (3) b. members[2:] (a) c. newlist[1:2] (O d. None of the above 13 What would you write in order to make a new list, members2, that contains everything in the members list except for the second element: Marks: 10 Choose one answer. (5) a. members2= members[1:] + members[2:] (3) b. members2= members[:1] + members[2:] (3) c. members2 = computerists [:1] + computerists[2:] (5) d. None of the above 14 What would you write in order to find out if'Ann'is in the members list Marks: 10 Choose one answer. (3) a. 'Ann' in members (3) b. members.find('Ann”) (5) c. members.sort ('Ann”) O d. None of the above 15 What would you do to delete the last element of the members list: Marks: 10 Choose one answer. (3) a. del members[:1] (9) b. members.pop() [a] c. del members [-1] (8) d. None of the above Save without submiting_| [ Submit all and finish |] You are logged in as YI WEN (Logout) 12-230589 |