|
|
|||||||||
|
|||||||||
|
|||||||||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
Python empty tuple evaluation
New to Python and having trouble understanding why the following does not print to the prompt. If None evaluates to false when treated as a condition, and as a condition, an empty tuple is false, then what is the problem?
Code:
# Create an empty tuple
inventory = ()
if inventory == None:
print "\nYou are empty handed!"
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > Python empty tuple evaluation |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|