Learn now: https://edu.csdn.net/course/play/26676/338784?utm_source=blogtoedu
Conditional statements:
if (the condition is true, the code block under it is executed):
Indent code blocks with four spaces
Rest code
if():
elif () :
elif () :
else:
import random
random.randint() Randomly generates an integer.
Ternary operation:
a = 'python' if x>2 else 'physics'
When x>2, a = python, otherwise a = physics