- Học kỳ
- SP2026
- Thời Gian
- 3/5/26
- Loại tài liệu
- FE
- Mã Đề
- PRP201c_SP26_RE_427988
PRP201c SP26 FE RE
1. (Choose 1 answer)
Which SQL command is used to retrieve rows?
A. SELECT
B. GET
C. FETCH
D. FIND
2. (Choose 1 answer)
Which operator checks for inequality in SQL?
A. !=
B. <>
C. NOT
D. A and B
3. (Choose 1 answer)
How are Python dictionaries different from Python lists?
A. Python lists store multiple values and dictionaries store a single value
B. Python dictionaries are a collection and lists are not a collection
C. Python lists are indexed using integers and dictionaries can use strings as indexes
D. Python lists can store strings and dictionaries can only store words
4. (Choose 1 answer)
What would the following Python code print out? stuff = dict() print(stuff['candy'])
A. - 1
B. 0
C. The program would fail with a traceback
D. candy
5. (Choose 1 answer)
What is the purpose of the following Python code? fhand = open('mbox.txt') x = 0 for line in fhand: x = x + 1 print x
A. Remove the leading and trailing spaces from each line in mbox.txt
B. Count the lines in the file 'mbox.txt'
C. Convert the lines in mbox.txt to upper case
D. Reverse the order of the lines in mbox.txt
6. (Choose 1 answer)
From: [email protected] From: [email protected] From: [email protected] From: [email protected]
A. find()
B. startswith()
C. rstrip()
D. split()
7. (Choose 1 answer)
What would the following mean in a regular expression? [a - z0 - 9]
A. Match any number of lowercase letters followed by any number of digits
B. Match a lowercase letter or a digit
C. Match an entire line as long as it is lowercase letters or digits
D. Match any text that is surrounded by square braces
8. (Choose 1 answer)
What will be the output of the following Python statement? >>>print(format("Welcome", "10s"), end = '#') >>>print(format(111, "4d"), end = '#') >>>print(format (924.656, ".2f"))
A. Welcome# 111#924.66
B. Welcome#111#924.66
C. Welcome#111#.66
D. Welcome # 111#924.66
9. (Choose 1 answer)
[no text]
A.
B.
C.
D.
10. (Choose 1 answer)
When calling a REST API, how is the request content typically different from a socket message?
A. REST uses formatted text (JSON)
B. REST sends binary only
C. Socket always encrypts data
D. REST uses formatted text (HTML)
11. (Choose 1 answer)
In Python what is the input() feature best described as?
A. A user - defined function
B. A built - in function
C. The central processing unit
D. A conditional statement
12. (Choose 1 answer)
Which of these operators is not a comparison / logical operator?
A. ==
B. >=
C. <=
D. =
13. (Choose 1 answer)
[no text]
A.
B.
C.
D.
14. (Choose 1 answer)
What is the value of x after running the following code? if x < 2: print('Below 2') elif x >= 2: print('Two or more') else: print('Something else')
A. x = - 2.0
B. This code will never print 'Something else' regardless of t he value for 'x'
C. x = 2.0
D. x = - 22
15. (Choose 1 answer)
What is the Python command to run a script named hello.py?
A. python hello.py
B. run hello.py
C. execute hello.py
D. open hello.py
16. (Choose 1 answer)
Which of these words is a reserved word in Python?
A. while
B. payroll
C. names
D. pizza
17. (Choose 1 answer)
For the following code: astr = 'Hello Bob' istr = 0 try: istr = int(astr) except: istr = - 1 What will the value be for istr after this code executes?
A. - 1
B. It will be the 'Not a number' value (i.e. NaN)
C. It will be a random number depending on the operating system the program runs on
D. false
18. (Choose 1 answer)
When you try to print type(3.2) in Python, what does the interpreter return?
A. <class int>
B. <class str>
C. <class float>
D. <class bool>
19. (Choose 1 answer)
[OCR: l ỗ i]
A.
B.
C.
D.
20. (Choose 1 answer)
Which of the following elements of a mathematical expression in Python is evaluated first?
A. Addition +
B. Multiplication *
C. Subtraction -
D. Parentheses ()
21. (Choose 1 answer)
In the following code (numbers added) - which will be the last line to execute successfully? (1) aStr = 'Hello Bob' (2) iStr = int(aStr) (3) printf("First", iStr) (4) aStr = '123' (5) iStr = int(aStr) (6) printf("Second", iStr)
A. 2
B. 6
C. 3
D. 5
22. (Choose 1 answer)
In the following code, print(98.6) What is "98.6"?
A. A variable
B. A constant
C. A parameter
D. A pointer
23. (Choose 1 answer)
How would you express the constant floating - point value 3.2×10³ in Python?
A. 3.2e - 3
B. 3.2e3
C. 0.32
D. 32e - 3
24. (Choose 1 answer)
``` Which method can be used to replace parts of a string?
A. replaceString()
B. repl()
C. switch()
D. replace() ```
25. (Choose 1 answer)
What is the correct way to define an empty list in Python?
A. {}
B. ()
C. []
D. None
26. (Choose 1 answer)
Which of the following is the correct syntax for calling a function in Python?
A. function_name arguments
B. function_name(arguments)
C. function_name(arguments)
D. function_name[arguments]
27. (C hoose 1 answer)
Which error is caught using try/except with files?
A. SyntaxError
B. IndexError
C. FileNotFoundError
D. NameError
28. (Choose 1 answer)
Which of the following are blocking event calls?
A. connect
B. resend
C. reject
D. disconnect
29. (Choose 1 answer)
What does the "[0 - 9]+" match in a regular expression?
A. One or more digits
B. Several digits followed by a p lus sign
C. Any mathematical expression
D. Any number of digits at the beginning of a line
E. Zero or more digits
30. (Choose 1 answer)
In the expression type(32), what is type?
A. A variable
B. A built - in function
C. keyword
D. A data type
31. (Choose 1 answer)
Which method of the socket module allows you to send data to a given address?
A. socket.sendto(address, data)
B. socket.address()
C. socket.sendto(data, add ress)
D. socket.data
32. (Choose 1 answer)
What is the output of print tinylist * 2 if tinylist = [123, 'john']?
A. [123, 'john', 123, 'john']
B. [123, 'john'] * 2
C. Error
D. None of the others
33. (Choose 1 answer)
Which of these is the right syntax to make a new table?
A. MAKE people;
B. CREATE TABLE people;
C. MAKE DATASET people;
D. CREATE people;
34. (Choose 1 answer)
fruit = "banana" Which of the following will result in an IndexError in Python?
A. fruit[5]
B. fruit[ - 1]
C. fruit[6]
D. fruit[ - 2]
35. (Choose 1 answer)
How are strings stored internally in Python 3?
A. inverted
B. Unicode
C. EBCDIC
D. UTF - 16
E. bubble memory
36. (Choose 1 answer)
Which keyword will cause the results of the query to be displayed in sorted order?
A. GROUP BY
B. ORDER BY
C. WHERE
D. None of these
37. (Choose 1 answer)
What is the primary added value of relational databases over flat files?
A. Ability to store data in a format that can be sent across a network
B. Ability to execute Python code within the file
C. Ability to quickly convert data to HTML
D. Ability to scan large amounts of data quickly
38. (Choose 1 answer)
What happens if a DELETE command is run on a table without a WHERE clause?
A. All the rows without a primary key will be deleted
B. The first row of the table will be deleted
C. It is a syntax error
D. All the rows in the table are deleted
39. (Choose 1 answer)
Which command is used to retrieve all record s from a table?
A. SELECT all FROM Users
B. RETRIEVE * FROM Users
C. SELECT * FROM Users
D. RETRIEVE all FROM User
40. (Choose 1 answer)
How can you delete all of the rows where the "name" is "Ruby" in the Cats Table?
A. DELETE FROM Cats WHERE name = 'Ruby'
B. DELETE name='Ruby' FROM Cats
C. DELETE ROW name='Ruby' FROM Cats
D. DELETE FROM Cats WHERE name == 'Ruby'
41. (Choose 1 answer)
Which SQL command is used to insert a new row into a table?
A. ADD ROW
B. INSERT ROW
C. INSERT INTO
D. INSERT AFTER
42. (Choose 1 answer)
Which command will try to remove data from a table in a database?
A. DELETE
B. REMOVE
C. COLLAPSE
D. DROP
43. (Choose 1 answer)
What is the primary added value of relational databases over flat files?
A. Ability to store data in a format that can be sent across a network
B. Ability to execute Python code within the file
C. Ability to quickly convert data to HTML
D. Ability to scan large amounts of data quickly
44. (Choose 1 answer)
In a typical online production environment, who has direct access to the production database?
A. UI/UX Designer
B. Database Administrator
C. Developer
D. Project Manager
45. (Choose 1 answer)
When you are doing a SELECT with a JOIN across multiple tables with identical column names, how do you distinguish the column names?
A. tablename/columnname
B. tablename.columnname
C. tablename - >columnname
D. tablename['columnname']
46. (Choose 1 answer)
In database terminology, another word for table is
A. relation
B. rows
C. attribute
D. view
47. (Choose 1 answer)
Which of the following are valid Cursor methods used to execute SQL statements and retrieve query results?
A. Cursor.get()
B. Cursor.execute()
C. Cursor.run()
D. Cursor.fetchmany()
48. (Choose 1 answer)
What is the output of repr('He llo \ nWorld')?
A. Hello World
B. 'Hello World'
C. 'Hello \ nWorld'
D. 'Hello/nWorld'
49. (Choose 1 answer)
What would the following code print if the word is "brontosaurus"? word = "brontosaurus" d = dict() for c in word: d[c] = d.get(c, 0) + 1 print(d)
A. {'b': 1, 'r': 2, 'o': 2, 'n': 2, 't': 1, 's': 1, 'a': 2, 'u': 1}
B. {'b': 1, 'r': 1, 'o ': 2, 'n': 2, 't': 1, 's': 1, 'a': 2, 'u': 2}
C. {'b': 1, 'r': 1, 'o': 2, 'n': 2, 't': 1, 's': 1, 'a': 2, 'u': 1}
D. {'b': 1, 'r': 1, 'o': 1, 'n': 1, 't': 1, 's': 1, 'a': 1, 'u': 1}
50. (Choose 1 answer)
What is the correct way to wr ite a string with both ' and " inside?
A. "She said 'Hi'"
B. 'She said "Hi"'
C. 'She said 'Hi''
D. All of the above
Đính kèm
-
PRP201c SP26 FE RE_01.webp15.4 KB · Lượt xem: 6 -
PRP201c SP26 FE RE_02.webp14.9 KB · Lượt xem: 6 -
PRP201c SP26 FE RE_03.webp39.3 KB · Lượt xem: 2 -
PRP201c SP26 FE RE_04.webp22.9 KB · Lượt xem: 1 -
PRP201c SP26 FE RE_05.webp38.8 KB · Lượt xem: 2 -
PRP201c SP26 FE RE_06.webp25.4 KB · Lượt xem: 1 -
PRP201c SP26 FE RE_07.webp36.1 KB · Lượt xem: 1 -
PRP201c SP26 FE RE_08.webp37.6 KB · Lượt xem: 0 -
PRP201c SP26 FE RE_09.webp9.5 KB · Lượt xem: 0 -
PRP201c SP26 FE RE_10.webp32.3 KB · Lượt xem: 0 -
PRP201c SP26 FE RE_11.webp22 KB · Lượt xem: 0 -
PRP201c SP26 FE RE_12.webp16.2 KB · Lượt xem: 0 -
PRP201c SP26 FE RE_13.webp9.6 KB · Lượt xem: 0 -
PRP201c SP26 FE RE_14.webp32.7 KB · Lượt xem: 0 -
PRP201c SP26 FE RE_15.webp19.9 KB · Lượt xem: 0 -
PRP201c SP26 FE RE_16.webp16.3 KB · Lượt xem: 0 -
PRP201c SP26 FE RE_17.webp37.3 KB · Lượt xem: 0 -
PRP201c SP26 FE RE_18.webp21.4 KB · Lượt xem: 0 -
PRP201c SP26 FE RE_19.webp9.8 KB · Lượt xem: 0 -
PRP201c SP26 FE RE_20.webp24.4 KB · Lượt xem: 0 -
PRP201c SP26 FE RE_21.webp31.9 KB · Lượt xem: 0 -
PRP201c SP26 FE RE_22.webp18.5 KB · Lượt xem: 0 -
PRP201c SP26 FE RE_23.webp19.5 KB · Lượt xem: 0 -
PRP201c SP26 FE RE_24.webp19.6 KB · Lượt xem: 0 -
PRP201c SP26 FE RE_25.webp15.9 KB · Lượt xem: 0 -
PRP201c SP26 FE RE_26.webp26 KB · Lượt xem: 0 -
PRP201c SP26 FE RE_27.webp19.6 KB · Lượt xem: 0 -
PRP201c SP26 FE RE_28.webp17 KB · Lượt xem: 0 -
PRP201c SP26 FE RE_29.webp29.2 KB · Lượt xem: 0 -
PRP201c SP26 FE RE_30.webp17.9 KB · Lượt xem: 0 -
PRP201c SP26 FE RE_31.webp25.6 KB · Lượt xem: 0 -
PRP201c SP26 FE RE_32.webp20.4 KB · Lượt xem: 0 -
PRP201c SP26 FE RE_33.webp22.9 KB · Lượt xem: 0 -
PRP201c SP26 FE RE_34.webp19.5 KB · Lượt xem: 0 -
PRP201c SP26 FE RE_35.webp18.7 KB · Lượt xem: 0 -
PRP201c SP26 FE RE_36.webp22.4 KB · Lượt xem: 0 -
PRP201c SP26 FE RE_37.webp34 KB · Lượt xem: 0 -
PRP201c SP26 FE RE_38.webp29.1 KB · Lượt xem: 0 -
PRP201c SP26 FE RE_39.webp23.5 KB · Lượt xem: 0 -
PRP201c SP26 FE RE_40.webp30.2 KB · Lượt xem: 0 -
PRP201c SP26 FE RE_41.webp19.7 KB · Lượt xem: 0 -
PRP201c SP26 FE RE_42.webp19 KB · Lượt xem: 0 -
PRP201c SP26 FE RE_43.webp34 KB · Lượt xem: 0 -
PRP201c SP26 FE RE_44.webp26.9 KB · Lượt xem: 0 -
PRP201c SP26 FE RE_45.webp34.2 KB · Lượt xem: 0 -
PRP201c SP26 FE RE_46.webp16.9 KB · Lượt xem: 0 -
PRP201c SP26 FE RE_47.webp27.4 KB · Lượt xem: 0 -
PRP201c SP26 FE RE_48.webp18.2 KB · Lượt xem: 0 -
PRP201c SP26 FE RE_49.webp37.4 KB · Lượt xem: 0 -
PRP201c SP26 FE RE_50.webp20.7 KB · Lượt xem: 6