• Python question of the day

    What would be output of executing this code:
    print(True*2)
     TrueTrue
     True True
     2
     Syntax Error
    Explanation:
    In python, True is boolean (notice the upper-case T) and True evaluates to 1 (False evaluates to 0) and hence 1 multiplied by 2 is 2


    Top 100 python interview questions:






datai analytics