☰ خطة العام · تكنولوجيا المعلومات والاتصالات (بالإنجليزية)

Strings in Python

الأسبوع 6 · الدرس ٣ «السلاسل النصية والقوائم في لغة Python» (١): السلاسل النصية والطول والفهرس والحلقة والبحث · 3 دروس
Answers are for parents and teachers.
1
What is len("good morning")? Count each character.
2
Draw the index sheet for "garden". Which letter is text[2] and which is text[-2]?
ABCDEF
1garden
2012345
3−6−5−4−3−2−1
3
What does this loop show?
Python
1for letter in "go":
2    print(letter)
4
A friend writes text[0] = "H" to change the first letter of “hello”. What happens and what can be done instead?
5
What do "5" + "2" and 5 + 2 give? Why do they differ?