Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam PCAP All Questions

View all questions & answers for the PCAP exam

Exam PCAP topic 1 question 25 discussion

Actual exam question from Python Institute's PCAP
Question #: 25
Topic #: 1
[All PCAP Questions]

What can you do if you don't like a long package path like this one?

  • A. you can make an alias for the name using the alias keyword
  • B. nothing, you need to come to terms with it
  • C. you can shorten it to alpha . zeta and Python will find the proper connection
  • D. you can make an alias for the name using the as keyword
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
tanst
Highly Voted 3 years, 1 month ago
Answer is D use as keyword
upvoted 6 times
...
TheFivePips
Most Recent 11 months, 3 weeks ago
Selected Answer: D
In Python, you can use the as keyword to create an alias for a long package path or module name. This allows you to use a shorter name in your code while still referencing the original package or module.
upvoted 1 times
...
Ello2023
1 year, 5 months ago
Selected Answer: D
use the "as" keyword to alias
upvoted 1 times
...
SonuSojan
1 year, 5 months ago
The Answer is 'D'. You can alias it using the 'as' keyword. B would be wrong, since it does not address the fact that you have to repeat the entire long path when you try to invoke a function from this package. SO just doing it once to alias makes it easy.
upvoted 1 times
...
baimus
1 year, 7 months ago
Selected Answer: B
I vote B on this, as D allows aliasing the package name, but does not address the fact you still have to write the long path. The path is not used during package invocation in any case, so to me the most accurate (though still terrible) answer is B
upvoted 1 times
...
baimus
1 year, 7 months ago
This is a confusing question, as in the import, the package would be used as only "Zeta" which doesn't include the path, so using the "as" to alias doesn't address what it asks (which is to circumvent having a long path)
upvoted 1 times
...
macxsz
2 years, 7 months ago
Selected Answer: D
D. you can make an alias for the name using the as keyword
upvoted 1 times
...
Alvienzo
3 years, 3 months ago
Answer is A
upvoted 2 times
sj_95
3 years, 3 months ago
Isn't D the correct answer? Ex: We use import numpy as np I am confused now.. Also, please let me know if you have given the exam PCAP-31-03 and if these questions came in it. Thanks!
upvoted 1 times
MarleenP
3 years, 1 month ago
right answer is D. 'as' is the keyword for an alias.
upvoted 3 times
...
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...