0
why this error?
>>> name = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" >>> print len(name) SyntaxError: invalid syntax >>>
7 Respuestas
+ 2
easy
lion = name[11] + name[8] + name[14] + name[13]
print(lion)
+ 2
try this
use print(len(name))
+ 2
yes, the parentheses are very important to the print method
+ 1
Thanks Joshua. It worked. But did I have to do it?
+ 1
how will you print LION from name?
print name[0]
will print A
how can i print multiple items
+ 1
Don't attribute yourself the best answer mark (green tick): it doesn't give you any XP, rather show a bad image of you (shame), and almost pervert this feature purpose, which is to highlight useful answer in addition to not be respectful of people who are spending time to help others @@
+ 1
I'm not sure which language you're using but it would be something like this:
print(name[0] + name[1] + name[2])
This would output ABC from your string.
+ is how you would do it in c#, other languages have different concatenation characters (e.g. & in VB iirc).