Python

Python Basic - Comparison operator & Logic operator

JY SHIN 2023. 8. 14. 17:26

Comparison Operator

Logic Operator
Logic operators just allow you to combine multiple comparison operations.

IF Condition
So a lot of times in other languages you would see a parentheses here and then some sort of condition

Everything just works off that colon.

For loops

Now, a common point of confusion for a new comers to Python is, does it have to be this keyword item?Well, actually, no, this can just be any temporary variable variable name that you want.

While Loop
While 조건 전까지 반복 

Range function
I can cast it into a list and it gets me back a list of integers and I can actually specify the starting point and the endpoint.

 

** Shit + tap -> 설명 제공 

 

 

0,1,2,3,4 => 5 hi 

List comprehension