2018年1月9日 星期二

Python: Perform an action if a condition is true

Python: Perform an action if a condition is true

Python Basic: Exercise-89 with Solution

Write a Python program to perform an action if a condition is true.
Given a variable name, if the value is 1, display the string "First day of a Month!” and do nothing if the value is not equal.
Sample Solution :-
n=1
if n == 1:
    print("\nFirst day of a month")
print()

======= RESTART: F:/Python_APSC/py-ex-basic-89.py ===========

First day of a month

>>> 

沒有留言:

張貼留言

2024產專班 作業2 (純模擬)

2024產專班 作業2  (純模擬) 1) LED ON,OFF,TIMER,FLASH 模擬 (switch 控制) 2)RFID卡號模擬 (buttom  模擬RFID UID(不從ESP32) Node-Red 程式 [{"id":"d8886...