Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

PCAP™ - Certified Associate in Python Programming Quizzes & Ans!!

Rating
-
Sold
-
Pages
10
Grade
A+
Uploaded on
07-05-2024
Written in
2023/2024

PCAP™ - Certified Associate in Python Programming Quizzes & Ans!!

Institution
PCAP™
Course
PCAP™

Content preview

PCAP™ - Certified Associate in Python Programming
Quizzes & Ans!!
import sys
How do I import the sys module but in a way that you must still use the sys.
namespace?
from pandas import DataFrame
How do I import only pandas.DataFrame so you don't need to type 'pandas.' when
calling DataFrame?
import pandas as pd
How do I import pandas so all I have to type when calling a function is pd?
from sys import *
How do I import everything from the sys module so I do not have to use the sys.
namespace when calling a function?
dir(math)
How do get python to list all of the attributes of the math module?
sys.path
How do I have python tell me what all the places it checks for modules is?
math.ceil(3.6)
How do I round 3.6 up to 4.0?
math.floor(3.6)
How do I round 3.6 down to 3.0?
math.trunc(3.6)
How do I remove the digits after the decimal place in 3.6?
factorial(5)
How do I find the product of all positive number less then or equal to 5?
hypot(3, 7)
I know the length of the two short sides of a triangle. How do I find the length of the long
side? The short sides are (3, 7).
sqrt(16)
How do I find what number times itself is 16?
random.random()
How do I make a random float number from 0 - 1?
randomn.seed(15)
I would like to set 15 as the seed for the random generation of float numbers from 0 - 1.
How do I do that?
choice(store)
store: list[int] = [5, 2, 8, 2] How do I pick a random number from this list?
random.sample(store, 3)
store: list[int] = [5, 2, 8, 2] I would like to pick a three random numbers from this list but I
don't want to reuse indexes that have already been selected. How do I do that? When I
do the a new list will be returned.
platform.platform()
How do I determine the os and version?
platform.machine()

, How do I find out the generic name of the processor which is being used on a
computer?
platform.processor()
How do I find out a detailed name of the processor which is being used on a computer?
platform.system()
How do I find out the generic os name of the computer I am on?
version()
I would like to have a string of my system's release version as a returned to me. How do
I do that?
platform.python_implementation()
How do I find out what python type I am using?
platform.python_version_tuple()
I would like a tuple of the python version returned to me. How do I get the (major, minor,
patch)
__pycache__
How does python speed up the startup time of a script or program? It does not have to
recompile given the source code has not changed.
main.py
If I run cat.py what will the __name__ be?
cat.py
If I run main.py and cat.py is imported into main.py what will the __name__ be for
cat.py?
_dog or __dog
What two ways can I notate dog is a "private" variable?
__init__.py
I need to provide some initialization functions for the files in my package. How can I do
that?
Nested Packages
What do you call it when there are packages inside of subfolders of packages each with
there own __init__ file?
import math, sys
How do you import the math and sys modules in one line?
sys.exit()
How do you raise a SystemExit error? This will exit the program.
AttributeError
What happens if you call a function that does not exits in a module?
from sys import exit as bye_bye
How do I import sys.exit as bye_bye?
round(3.5)
How do I round 3.5 the normal math way?
sys.path.append()
How do I add a place for python to check for modules?
Directory Trees
What style of packaging is it considered when you have a file structure like package?
256
How many code points does the ASCII have?

Written for

Institution
PCAP™
Course
PCAP™

Document information

Uploaded on
May 7, 2024
Number of pages
10
Written in
2023/2024
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

CA$26.44
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Aplusplus Havard School
Follow You need to be logged in order to follow users or courses
Sold
3850
Member since
2 year
Number of followers
89
Documents
6018
Last sold
5 days ago
GOLD REPUTATION

PREMIUM DOCUMENTS. GREAT REVIEWS Many students don't have the time to work on their academic papers due to balancing with other responsibilities, for example, part-time work. I can relate. kindly don't hesitate to contact me, my study guides, notes and exams or test banks, are 100% graded

4.6

241 reviews

5
208
4
9
3
9
2
0
1
15

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions