Post

yourclouddude
yourclouddude@yourclouddude·
@PythonPr Output is A .... In Python, True == 1 is true, so the first condition runs and prints "A". After that, Python skips the elif and else. Small but important detail: == checks value, while is checks identity.
English
0
0
4
607
Manil Nallapaneni
Manil Nallapaneni@Manil236·
@PythonPr The elif condition runs when the if condition is false. so,the output is A
English
0
0
4
886
Gopuff
Gopuff@gopuff·
There's no middleman here to mark things up. Orders come straight from our shelves to you in as fast as 15 minutes.
English
95
135
1.1K
10.4M
Kylo Ren
Kylo Ren@KyloRen25644566·
@PythonPr This was tricky. I remembered in Python " True" and "False" are similar to Boolean Integers 1,0. So if x =True, then 1==1 would print "A". Once this condition is met, elif and else statment no longer executes. Outpu is "A"
English
0
0
1
269
moonlight
moonlight@thewizardofOzii·
@PythonPr True=1 in python x==1 1==1 Output A
English
0
0
1
240
Xian
Xian@DG_Xian·
@PythonPr A, it's a boolean value.
English
0
0
0
592
Amazon
Amazon@amazon·
Shop luxury fashion finds at Amazon 👜
English
4
30
110
32.8M
Bob Armstrong
Bob Armstrong@CoSyBobA·
@PythonPr Moore in FORTH uses " not 0 " as True with -1 canonical True . Iverson APL uses 1 ( single bit ) True so arithmetic works . CoSy converts early at the FORTH level . : 0=I not negate ; : M->I not 0=I ; : I->M not not ;
English
0
0
0
214
Paylaş