• Python question of the day

    What would be the output of executing the following code:
    lang = ['Julia', 'R', 'Python']
    src = 'Learned Julia, Python, and R'.split(' ', 3)
    print(any(i in lang for i in src))
     Julia
     Python
     True
     False
    Explanation:
    The expression 'Learned Julia, Python, and R'.split(' ', 3) creates ['Learned', 'Julia,', 'Python,', 'and R'] and since none in the list matches with the list lang, the result is False


    Top 100 python interview questions:


  • python bootcamp 2021
datai analytics