Question:39ThevariableEmpCodecontainsvaluessuchas999FLand888MX.

Thefourthcharacteridentifiessex.HowdoyouassignthesecharactercodestoanewvariablenamedMaleORFemale?

1.MaleORFemale=scan(empcode,4);

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:4

TheSUBSTRfunctionisbestusedwhenyouknowtheexactpositionofthesubstringtoextractfromthecharactervalue.Youspecifythepositiontostartfromandthenumberof

characterstoextract.Syntax:SUBSTR(variable,position(,length))=characters-to-replace

RequiredArguments

variable:specifiesacharactervariable.

position:specifiesanumericconstant,variable,orexpressionthatisthebeginningcharacterposition.

characters-to-replace:specifiesacharacterconstant,variable,orexpressionthatwillreplacethecontentsofvariable.

Tip:Enclosealiteralstringofcharactersinquotationmarks.

OptionalArgument

You can access to full explanation to question and answer from this page.