CBSE Class 12 Computer Science
Question 4 of 42
Solved 2024 Sample Question Paper CBSE Class 12 Computer Science (083) — Question 4
Back to all questionsPYTHON-is-Fun
Reason — The code initializes a string variable s with the value 'Python is fun'. It splits the string into words using split() method, then converts the first word to uppercase ('PYTHON') using indexing and the upper() method, and capitalizes the third word ('Fun') with the capitalize() method. It then joins the modified words with a hyphen ('-') as the separator using the join() method and prints the result.