zorky

Need help producing these outputs..

Discussion created by zorky on Mar 28, 2012
Latest reply on Mar 29, 2012 by fabl
Hey guys,


I need help finding the correct way of using the multiplicatiom operator in this problem.. (I only need one example showing how it's implemented, dont give me all the answers for the problem)

Assign s1 = '-' and s2 = '+' in the Python shell. Then write string expressions involving only s1 and s2 and the string operators + and * that evaluate to the following. Make your string expressions as succinct as you can.
a. '-+'
b. '+-'
c. '+--'
d. '+--+--'
e. '+--+--+--+--+--+--+--+--+--+--'
f. '+-+++--+-+++--+-+++--'

Outcomes