Examination date: All year round (check the examination venue as it is also held at computer schools) Application URL: http://cbt.odyssey-com.co.jp/pythonic-exam.html Examination fee: 10,000 yen (excluding tax)
Exam name: Python3 engineer certification basic exam (English name: Python 3 Certified Engineer Basic Examination) Qualification name: Python3 engineer certification basic examination passer (English name: Python 3 Basic Grammar Certification) Summary: Exams that ask the basics of grammar Number of questions: 40 questions (all selection questions: 1 question 25 points calculation) Test time: 60 minutes Pass line: 70% correct answer rate Scope of questions: O'Reilly Japan "Python Tutorial 3rd Edition" and general knowledge
https://diver.diveintocode.jp/exam
I'm a beginner.
■Progato ・ Ruby ・ Python
■Kaggle ・ Only touch
■Rails tutorial ・ Completed up to the final 14 chapters
From here, I will write the answer based on the question.
Correct answer: pip list
pip is used for package management. The main thing you can do is package ・ Installation ·upgrade ・ Remove There are various other commands, some of which are summarized in the table below.
subcommand | meaning |
---|---|
install | Can be installed by specifying a package --You can install the latest version with update |
uninstall | Reverse of install |
freeze | List of installed packages (display for install) |
list | View all packages installed in the virtual environment |
show | show Show package information by package name |
Correct answer: 0 1 2
num_list = [2, 4, 6, 4, 4, 2, 6]
for i in range(num_list.count(4)):
print(i, end=' ')
count is a method to count the number of targets. By repeating with for and entering end ='' Expressed as 0 1 2.
Correct answer: Noro
def dive_into_code(teacher, *mentor):
print(teacher)
dive_into_code('Noro', 'Nakao', 'Miyaoka')
The erratic positional arguments ('Nakao','Miyaoka') are collectively assigned to (* menter).
Similar problems
dic = [
['Noro', 'Nakao', 'Miyaoka'],
['Kimura', 'Miyashita', 'Shibata'],
['Matsumoto', 'Tanaka', 'Ivan'],
]
print(list(zip(*dic)))
Correct answer: [('Noro','Kimura','Matsumoto'), ('Nakao','Miyashita','Tanaka'), ('Miyaoka','Shibata','Ivan')]
Mock exam questions
dive_into_code = [(1, 'Noro'), (2, 'Nakao'), (3, 'Miyaoka'), (4, 'Kimura')]
dic = dive_into_code
#1 sorts the second element in ascending order. If it is 0, the first element is sorted in ascending order.
dic.sort(key=lambda dic: dic[1])
print(dic)
Correct answer: [(4,'Kimura'), (3,'Miyaoka'), (2,'Nakao'), (1,'Noro')]
So you sort by K → M → Na → No.
Correct answer: xxxxCODExxxxDIVExxxxDIVE
replace.py
d = 'xxxxDIVExxxxDIVExxxxDIVE'
print(d.replace('DIVE', 'CODE', 1))
String.replace (string before replacement, string after replacement, maximum number of times)
Correct answer: 3.142
% Overall width. Width after the decimal point f
format.py
print("Output result:")
print('Pi is%5.It is 3f.'%math.pi)
Pi is 3.142
Correct answer: [('Noro','Kimura','Matsumoto'), ('Nakao','Miyashita','Tanaka'), ('Miyaoka','Shibata','Ivan')]
How to change list type: list to dictionary type: dictionary using zip
zip.py
dic = [
['Noro', 'Nakao', 'Miyaoka'],
['Kimura', 'Miyashita', 'Shibata'],
['Matsumoto', 'Tanaka', 'Ivan'],
]
print(list(zip(*dic)))
I referred to the following. https://pg-chain.com/python-dictionary-list
that's all
Recommended Posts