Skip to content
Advertisement

Tag: expression

Starred expression in ternary operator python

I wrote a python program to print the ascii value of up to every 3 numbers in a string or “ERROR” if the length is not divisible by three. I was golf the code when I ran into a SyntaxError. Code: But this works: Putting a space before the * or after the 3 doesn’t work. I could just use

Advertisement