M
M
Max Payne2018-03-09 00:44:30
Python
Max Payne, 2018-03-09 00:44:30

Can this code be written in one line?

Is it possible to write such Python code in one line?

result = f()
if type(result) == dict: f2(result)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Max Payne, 2018-03-09
@YardalGedal

(lambda result: f2(result) if type(result) == dict else None)(f1(data))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question