
Command Line and Recursion in Python - Python Basics with Sam
video description
So what in the world are Truthy and Falsy values ?
Well Truthy and Falsy values and individual values of whatever data type meaning that they could be ints. floats, lists, dicts and so on , that evaluate down to one of the Two Boolean values i.e that is it could be either True and False bear with me !!!
So now we can conclude that They are values or objects that evaluate down to True or False meaning that they can be used in Boolean context
As part of a Boolean expression or just alone as an if or while condition
So the question is how can we tell whether a value is Truthy( it evaluates to True) or Falsy( it evaluates to False)?
Well there's a set of rules you can look them up i am lazy to lay them off !!! set by python community that we follow through
A bit of a hint
any numeric value that is not 0 is a Truthy value and as you might guess any 0 numeric value is a Falsy value this explains why 0 == False is True because False == False is a True expression
Date: 2022-03-14
Related videos
Comments and reviews: 2
Muhammad
After the return statement sam said that -everything is a dead code - my question is . Does all of code below gets dead or just within a function or if-else statements?
reply
After the return statement sam said that -everything is a dead code - my question is . Does all of code below gets dead or just within a function or if-else statements?
reply
sourabh
Reason why 0! is 1:
6! = 720
5! = 120 (720/6)
4! = 24 (120/5)
3! = 6 (24/4)
2! = 2 ( 6/3)
1! = 1 (2/2)
0! = 1 (1/1)
Hope you got it.
reply
Reason why 0! is 1:
6! = 720
5! = 120 (720/6)
4! = 24 (120/5)
3! = 6 (24/4)
2! = 2 ( 6/3)
1! = 1 (2/2)
0! = 1 (1/1)
Hope you got it.
reply
Add a review, comment















