Python basic if statement

Python basics ①

Notes for output

if statement


number = 40
if number > 30:
     print "hello world!"
     print "Hello World!"

Comparison operator> <> = <= ==! = Logical operator and or not


if number > 50 and number < 70:
     print "hello world!"
     print "Hello World!"
if 50 < number <70
     print print "hello world!"
     print "Hello World!"`

number = 60
if number > 50:
     print "hello world!"
elif number > 30:
     print "Hello World!"
else:
     print "HELLO WORLD"

print "yes" if number > 60 else "no"

Engineer career change activity reference site

Recommended Posts

Python basic if statement
Python if statement
[Python] if statement
Addition with Python if statement
[python] Correct usage of if statement
[Python] File operation using if statement
Basic Python writing
Python exec statement
Python3 basic grammar
Python assert statement
[Python] Basic pattern and usage of if statement (comparison operator and Boolean operator)
Python basic course (12 functions)
Python I'm also basic
Python basic grammar / algorithm
Python Basic Course (7 Dictionary)
Python basic course (2 Python installation)
Python basics ② for statement
[Go] Basic grammar ② Statement
[python] class basic methods
Python Basic Course (11 exceptions)
[Super basic] Compare Python, Java and JavaScript (variable, if statement, while statement, for statement)
Python3 cheat sheet (basic)
Python basic grammar (miscellaneous)
Python Basic Course (Introduction)
Python basic memorandum part 2
python basic on windows ②
Python basic memo --Part 2
Python basic course (13 classes)
Basic Python command memo
Python basic grammar note (3)
Basic knowledge of Python
OpenCV basic code (python)
Python basic memo --Part 1
python memorandum super basic
Python basic course (8 branches)
[Python] for statement error
Python Basic Course (3 Python Execution)
Python Basic --Pandas, Numpy-
Python Exercise for Beginners # 1 [Basic Data Types / If Statements]
A Java programmer studied Python. (for, if, while statement)
Basic Python 3 grammar (some Python iterations)
Python application: Pandas Part 1: Basic
Python list, for statement, dictionary
Refactoring Learned in Python (Basic)
Python "if __name__ == ‘__main__’: ”means
BASIC authentication with Python bottle
Python basic dict sort order
[Python] if __name__ == What is'__main__' :?
Python basic course (10 inclusion notation)
Python Basic Grammar Memo (Part 1)
Python basic grammar (miscellaneous) Memo (3)
Python basic grammar (miscellaneous) Memo (2)
Basic Python grammar for beginners
[Python] [SQLite3] Operate SQLite with Python (Basic)
About 2-variable, 4-branch if statement
[Python / PyQ] 4. list, for statement
Basic usage of Python f-string
I learned Python basic grammar
Python basic grammar (miscellaneous) Memo (4)
Python (Python 3.7.7) installation and basic grammar
Python Basic Course (1 What is Python)