Comparison operators

MATLAB उपयोगकर्ताओं के लिए Python

Justin Kiggins

Product Manager

तुलना ऑपरेटर का उपयोग

value = 0.967
threshold = 0.85

meets_criteria = value > threshold

print(meets_criteria)
True
MATLAB उपयोगकर्ताओं के लिए Python

तुलना ऑपरेटर

तुलना Python MATLAB
बराबर == ==
बराबर नहीं != ~=
से छोटा < <
से छोटा या बराबर <= <=
से बड़ा > >
से बड़ा या बराबर >= >=
MATLAB उपयोगकर्ताओं के लिए Python

If

value = 0.967
threshold = 0.85

meets_criteria = value > threshold

if meets_criteria: print('PASS')
PASS
MATLAB उपयोगकर्ताओं के लिए Python

Else

value = 0.275
threshold = 0.85

meets_criteria = value > threshold

if meets_criteria: print('PASS') else: print('FAIL')
FAIL
MATLAB उपयोगकर्ताओं के लिए Python

Else if

porridge_temperature = 74.6

if porridge_temperature > 130: print('Too hot! :(') elif porridge_temperature < 110: print('Too cold! :(') else: print('Just right :D')
Too cold! :(
MATLAB उपयोगकर्ताओं के लिए Python

अभ्यास करते हैं

MATLAB उपयोगकर्ताओं के लिए Python

Preparing Video For Download...