+ 2

Python if statement

What's the number or string in an "if" statement (in Python) called, in technical Python terms? If ==2, what would we call the number "2" here?

7th Mar 2018, 10:03 PM
arbaaz
8 ответов
+ 5
That 2 is an integer. But if you write: if x == 2: ... Then x==2 returns either True or False, which are type Boolean.
7th Mar 2018, 10:19 PM
Pedro Demingos
Pedro Demingos - avatar
+ 1
integer
7th Mar 2018, 10:16 PM
Markus Kaleton
Markus Kaleton - avatar
+ 1
When comparing "2" to something before, what would it be called?
8th Mar 2018, 10:15 PM
arbaaz
0
i think its integer, btw the indentation is about 2 spaces
9th Mar 2018, 11:21 AM
Florin Caciur
Florin Caciur - avatar
0
@Florin indentation in python is always 4 spaces unless you are making a visual indentation
9th Mar 2018, 1:18 PM
Markus Kaleton
Markus Kaleton - avatar
0
i think so
9th Mar 2018, 1:20 PM
Florin Caciur
Florin Caciur - avatar
- 1
ber bhs indo aja gays
10th Mar 2018, 5:09 AM
suko prasojo
- 1
soalnya saya gk bisa bhs ing
10th Mar 2018, 5:09 AM
suko prasojo