(a) Given is a Python string declaration:

myexam="@@CBSE Examination 2022@@"

Write the output of: print(myexam[::-2])

 

Answer:

Output 20 otnmx SC -Teachoo.png

Output: @20 otnmx SC@

Explanation:

myexam[::-2] gives every second element of the string starting from the end of the string.

Remove Ads
Teachoo · Class 12 Explore Class 12
Davneet Singh's photo - Co-founder, Teachoo

Made by

Davneet Singh

Davneet Singh is an IIT Kanpur graduate and has been teaching for 16+ years. At Teachoo, he breaks down Maths, Science and Computer Science into simple steps so students understand concepts deeply and score with confidence.

Many students prefer Teachoo Black for a smooth, ad-free learning experience.