Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
Location Chicago IL, USA

Exam PCAP topic 1 question 15 discussion

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

Assuming that String is six or more letters long, the following slice
is shorter than the original string by:

  • A. four chars
  • B. three chars
  • C. one char
  • D. two chars
Show Suggested Answer Hide Answer

Suggested Answer: A

Comments

Avidulam
8 months, 2 weeks ago
Ans is B, three chars less
upvoted 11 times
...
apextek1
8 months, 2 weeks ago
Answer is B. 3 characters
upvoted 6 times
...
yosra
7 months, 3 weeks ago
B is the answer
upvoted 6 times
...
pshdreddy
6 months, 1 week ago
Question was 6 or more.if he consider 7 word string then ans was A.if he consider 6 words string then answer was B >>> str = 'examtop' >>> str[1:-2] 'xamt' >>>
upvoted 4 times
M7mdAl7aj
5 months ago
the result is 4 characters which is 3 characters shorter than the original string.
upvoted 4 times
...
Darkhorse7979
3 months, 4 weeks ago
The answer always will be 3 characters less as the character at index 0 is excluded and the last 2 characters are excluded
upvoted 3 times
...
...
Divyaera
6 months, 1 week ago
Answer is B
upvoted 2 times
...
Saifu
6 months ago
Answer is always B, three chars less. Last 2 characters are dropped by the -2 and the starting index is 1 instead of 0, so first character is dropped
upvoted 4 times
...
premaseem
3 months, 2 weeks ago
It would skip the first character and last 2 characters. Answer should be B
upvoted 1 times
...
Nehuuu
2 months, 1 week ago
Answer should be B
upvoted 1 times
...
ecko
2 months, 1 week ago
There is not a right answer on here because it really depends on how long the string is. If it has six letters then print will produce three of those letters. It'll increase depending on how many letters are in the string.
upvoted 2 times
FR99
3 weeks, 3 days ago
Pay attention on the question's wording. It will always be 3 characters shorter regardless the length of the string.
upvoted 1 times
wolverin3
1 week, 1 day ago
Not really, question should mention atleast or regardless but it says original length of string.
upvoted 1 times
wolverin3
4 days ago
sorry, I interpreted the question wrongly. No matter the length of string it is 3 characters short of the original string
upvoted 1 times
...
...
...
...

SaveCancel