Session3 : Today's Learning
1840 ワード
The sequence of methods in the same command line
# If there are a sequence of methods in the same command line, methods are executed from left to right.
string1 = "2022-03-21"
string1.replace('-','/').replace('2022/0','')
print(string1)
# "3/21"
Another effective way to input arguments at Terminal
# Instead of using 'input()', you can use 'readline()' method from 'stdin' module of 'sys' package.
import sys
n = sys.stdin.readline().rstrip()
# you'd better use '.rstrip()' to remove the following '\n'.
Reference
この問題について(Session3 : Today's Learning), 我々は、より多くの情報をここで見つけました https://velog.io/@ziwe_ek/Session3-Todays-Learningテキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol