PYTHON QUESTIONS: a): Given three int variables that have been given values, are
ID: 3876602 • Letter: P
Question
PYTHON QUESTIONS:
a): Given three int variables that have been given values, areaCode, exchange, and lastFour, write a string expression whose value is the string equivalent of each these variables joined by a single hyphen (-) So if areaCode, exchange, and lastFour, had the values 800, 555, and 1212, the expression's value would be "800-555-1212". Alternatively, if areaCode, exchange, and lastFour, had the values 212, 867 and 5309 the expression's value would be "212-867-5309". b):Given a String variable named sentence that has been initialized, write an expression whose value is the index of the very last character in the String referred to by sentence.
Explanation / Answer
Answer :
a) Area Code + "-" + exchange + "-" + lastFour
b) String sentence=object.readline();
int len=(s.length()-1);
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.