KnowledgeBoat Logo
|

Robotics & Artificial Intelligence

Write the output of the print command in the given table.

a = "Python World"

Print statementOutput
print(a[0]) 
print(a[-2]) 
print(a[5]) 
print(a[7]) 
print(a[-9]) 
print(a[10]) 

Python String Manipulation

2 Likes

Answer

The output of the print commands is given below:

Print statementOutput
print(a[0])P
print(a[-2])l
print(a[5])n
print(a[7])W
print(a[-9])h
print(a[10])l

Explanation:

01234567891011Python World121110987654321\begin{matrix} 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 \ \bold P & \bold y &\bold t &\bold h &\bold o &\bold n & \space &\bold W &\bold o &\bold r &\bold l &\bold d \ -12 & -11 & -10 & -9 & -8 & -7 & -6 & -5 & -4 & -3 & -2 & -1 \ \end{matrix}

Answered By

1 Like


Related Questions