exam questions

Exam 350-401 All Questions

View all questions & answers for the 350-401 exam

Exam 350-401 topic 1 question 851 discussion

Actual exam question from Cisco's 350-401
Question #: 851
Topic #: 1
[All 350-401 Questions]



Refer to the exhibit. What is the output of this code?

  • A. 1st_item#######: 645298791871446
    2nd_item_that_must_display: jlugyydt##
  • B. 1st_item#######: 6452987918
    2nd_item_that_m: jlugyydt##
  • C. 1st_item#######: 8791871446
    at_must_display: jlugyydt
  • D. 645298791871446
    ##jlugyydt
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

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
Alondrix
Highly Voted 1 year, 6 months ago
Answer is A. {:#<15} - This is adding # to the returned string to fill 15 characters. It does nothing if the string is greater than 15 characters. {:#<10} - This is adding # to the returned string to fill 10 characters. It does nothing if the string is greater than 10 characters.
upvoted 14 times
sharonmiller
9 months, 2 weeks ago
.. the string is already 15 characters... so why is it adding all the '#'??
upvoted 1 times
sharonmiller
9 months, 2 weeks ago
nevermind... i blame cisco lol.. the key AND the value characters are counted... got it.
upvoted 1 times
...
...
...
ebulating
Highly Voted 9 months ago
I've been using Python for 15 years and have never needed to use these obscure formatting specifiers.
upvoted 10 times
...
chiacche
Most Recent 7 months, 2 weeks ago
txt = '{:#<15} : {:#<10}'.format(key, str(value)) Key left-aligned with 15 characters, fill remaining with '#'. Value left-aligned with 10 characters, fill remaining with '#'.
upvoted 2 times
...
[Removed]
10 months, 3 weeks ago
Selected Answer: A
i will also go with A, trusting the others
upvoted 1 times
...
[Removed]
11 months, 2 weeks ago
i will also go with A, trusting the others
upvoted 1 times
...
Osama_anwar
1 year, 1 month ago
Selected Answer: A
A is correct
upvoted 2 times
...
gorillaenhanced
1 year, 2 months ago
Selected Answer: A
Answer is A
upvoted 4 times
...
AM17212
1 year, 3 months ago
Selected Answer: A
I have applied the same script and the output is A: >>> args_dict = { ... '1st_item':'645298791871446', ... '2nd_item_that_must_display':'jlugyydt' ... } >>> for key,value in args_dict.items(): ... txt = '{:#<15} : {:#<10}'.format(key,str(value)) ... print(txt) ... 1st_item####### : 645298791871446 2nd_item_that_must_display : jlugyydt## >>>
upvoted 3 times
...
Jakubu1
1 year, 4 months ago
Did anyone take the exam and have this question? What was the answer? While Python's books may have one answer, Cisco's exam's decision for the correct answer is what decides the correct answer for Cisco unfortunately, so would love to now.
upvoted 1 times
Mizuchan
1 year, 3 months ago
It is A
upvoted 1 times
...
...
reheheeeehe
1 year, 4 months ago
Selected Answer: A
https://www.online-python.com/ args_dict = { '1st_item':'645298791871446', '2nd_item_that_must_display':'jlugyydt' } for key,value in args_dict.items(): txt = '{:#<15} : {:#<10}'.format(key,str(value)) print(txt) Output: 1st_item####### : 645298791871446 2nd_item_that_must_display : jlugyydt##
upvoted 4 times
...
Will_91
1 year, 6 months ago
Selected Answer: A
Tested its A
upvoted 3 times
...
BoyuanLIU
1 year, 6 months ago
Selected Answer: A
in "B" - The value '6452987918' is truncated to 10 characters, which does not happen in Python's string formatting; the entire string should be displayed even if it exceeds the specified width.
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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago