I wrote an article about what I learned in the Python 3 Engineer Certification Basic Exam.
Exam Name: Python 3 Engineer Certification Basic Exam Number of questions: 40 questions Question format: Selection formula Test method: CBT (Computer Based Testing) format conducted on a computer Test time: 60 minutes Pass criteria: 70% correct answer Examination fee: General price 11,000 yen (tax included) Student discount price: 5,500 yen (tax included)
Question range The range of questions will be given in the following ratio from the main teaching material, O'Reilly Japan "Python Tutorial 3rd Edition".
Click here for details https://cbt.odyssey-com.co.jp/pythonic-exam.html
Question 1 Select the output result when the following program is executed.
terminal
import json
x = {'name':'yamada','data':[2,3,4]}
print(json.dumps(x))
JSON (JavaScript Object Notation) is a lightweight data exchange format. It is a format that is easy for humans to read and write, and easy for machines to parse and generate.
json.dumps () is a function that can encode Python objects into JSON format.
The execution result is as follows.
terminal
{"name": "yamada", "data": [2, 3, 4]}
json --- JSON encoder and decoder https://docs.python.org/ja/3/library/json.html?highlight=json
Question 2 I want to execute the program and obtain the following execution results.
terminal
2017-09-11
Select the combination of codes to be written in (A) and (B) of the program below from the options.
terminal
from (A) import (B)
now = date.today()
print(now)
Correct answer: (A) datetime (B) date
datetime --- Basic date and time types https://docs.python.org/ja/3/library/datetime.html
Q3 Select the correct output result when the following program is executed.
terminal
dic = 'diveintocode'
print(dic[1:10:2])
Output by skipping one from the 1st element to the 10th element (iveintocod) of the variable dic that contains the character string.
The execution result is as follows.
terminal
ienoo
Q4 Choose the appropriate build-in function dir ().
The dir () function is a built-in function that allows you to look up a list of defined functions and attributes.
terminal
dir()
terminal
['In',
'Out',
'_',
'_5',
'_6',
'_7',
'_8',
'__',
'___',
'__builtin__',
'__builtins__',
'__doc__',
'__loader__',
'__name__',
'__package__',
'__spec__',
'_dh',
'_i',
'_i1',
'_i10',
'_i2',
'_i3',
'_i4',
'_i5',
'_i6',
'_i7',
'_i8',
'_i9',
'_ih',
'_ii',
'_iii',
'_oh',
'_sh',
'dic',
'exit',
'get_ipython',
'json',
'quit',
'sample_no',
'sample_txt',
'x']
Correct answer: You can see the name defined by the module.
Q5 Select the correct output result of executing the following program with the interpreter.
By using argv in the sys (system parameter) module You can pass arguments when running a Python program.
test.py
import sys
print(sys.argv)
Execute it with the following command.
terminal
$ python test.py test
The execution result is as follows.
terminal
['test.py', 'test']
sys --- System parameters and functions https://docs.python.org/ja/3/library/sys.html#sys.argv
Q6 Select the output result when the following program is executed.
terminal
d = 'dive\ninto\ncode\t'
print(len(d))
Returns the length (number of elements) of the Python object.
The execution result is as follows.
terminal
15
Q7 In the interactive environment, select the file in which the history information is saved from the options.
Correct answer: .python_history
Q8 Select the output result when the following program is executed.
terminal
a = 2
b = 5
c = 3.0 + b, 5 * a
print(c)
Tuple elements are arbitrary Python objects. Tuples consisting of two or more elements consist of comma-separated expressions that represent the individual elements.
The execution result is as follows.
terminal
(8.0, 10)
Q9 Select the correct output result when the following program is executed.
terminal
d = 'xxxxDIVExxxxDIVExxxxDIVE'
print(d.replace('DIVE', 'CODE', 1))
Copies the string and returns all appearing substrings replaced with new. If the optional argument count is given, it replaces only the first count of old.
terminal
xxxxCODExxxxDIVExxxxDIVE
Q10 Select the output result when the following program is executed.
terminal
print(range(5))
Adds the number specified in step in order from the number specified in start, and creates an object that has consecutive numbers as elements up to the range that does not exceed the number specified in stop.
The execution result is as follows.
terminal
range(0, 5)
Q11 With python interpreter
terminal
D:\home\name\python
Select the correct input to output.
Correct answer: print (r'D: \ home \ name \ python')
Raw string that ignores (disables) escape sequences in Python https://note.nkmk.me/python-raw-string-escape/
Q12
terminal
(1,3,5) < (1,2,3,4)
terminal
FALSE
Recommended Posts