KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Possible Duplicate: Putting a simple if-then statement on one line I am working on a python expression and I want that expression to be compressed than using the if else statement. s = [1, 2, 3, 4] if len(s)>5: print s.index(5) else: print 'cant print' Is there a better way than using as if else statement?
Tags (comma-separated)
Save Edits
Cancel