python commands list code example
Example 1: python list methods
list.append(x)
list.extend(iterable)
list.insert(i, x)
list.remove(x)
list.pop([i])
list.clear()
list.index(x[, start[, end]])
list.count(x)
list.reverse()
list.sort(key=None, reverse=False)
list.copy()
Example 2: python commands
simple python commands
print("your text here")
-----------------------------
name = input("what is your name")
print("nice to meet you " + name)
-----------------------------
A = int(input("give me the first num "))
B = int(input("give me the second num "))
f = A + B
print(f)
Example 3: python standard library
Example 4: python standard library
>>> from datetime import timedelta
>>> delta = timedelta(
... days=50,
... seconds=27,
... microseconds=10,
... milliseconds=29000,
... minutes=5,
... hours=8,
... weeks=2
... )
>>>
>>> delta
datetime.timedelta(days=64, seconds=29156, microseconds=10)