Ana sayfa
/
Teknoloji
/
What is the output of the following ; code? my_(-)string=""python' print(my_(-)string[1]) error h p y

Soru

What is the output of the following ; code?
my_(-)string=""python'
print(my_(-)string[1])
error
h
p
y

What is the output of the following ; code? my_(-)string=""python' print(my_(-)string[1]) error h p y

Çözüm

4.3253 Voting
avatar
Savas
Elit · 8 yıl öğretmeni
Uzman doğrulaması

Cevap

The output of the given code is 'p'. The string $my_{-}string$ is defined as '""python''. The print statement is trying to print the second character of the string, which is 'p'.
Derecelendirmek için tıklayın: