Python Programming Basics

Python Programming Basics

Copyright 2018 ? Huawei Technologies Co., Ltd

Contents

1. Introduction to Python 2. Lists and Tuples 3. Strings 4. Dictionaries 5. Conditional and Looping Statements 6. Functions 7. Object-Oriented Programming

8. Date and Time

9. Regular Expressions 10. File Manipulation

Copyright Huawei Technologies Co., Ltd

Page 2

Getting the Current Date and Time

Let's see how to get the current date and time.

>>> from datetime import datetime >>> now = datetime.now() # Get the current datetime >>> print(now) 2015-05-18 16:28:07.198690 >>> print(type(now)) ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download