Question:38ThevariableAddress2containsvaluessuchasNewdelhidl,DL.Howdoyouassignthetwo-letterstateabbreviationstoanewvariablenamedCapital?
1.Capital=scan(address2,2);
2.Get all Questions and Answer from here
3.You need to have paid subscription to access all questions
4.Thanks for considering Python Certification Material
CorrectAnswer:1
TheSCANfunctionisusedtoextractwordsfromacharactervaluewhenyouknowtheorderofthewords,whentheirpositionvaries,andwhenthewordsaremarkedbysomedelimiter.
Inthiscase,youdon'tneedtospecifydelimiters,becausetheblankandthecommaaredefaultdelimiters.
SyntaxSCAN(string,count(,charlist(,modifiers)))
RequiredArguments
string:specifiesacharacterconstant,variable,orexpression.
You can access to full explanation to question and answer from this page.