@@ -5,4 +5,21 @@ print([1, 2, 3, 4]+[6, 7, 8, 9]) # [1,2,3,4,5,6,7,8,9]
# 乘法
print([42]*10) # [42, 42, 42, 42, 42, 42, 42, 42, 42, 42]
-# None、空列表和初始化
+# None、空列表和初始化
+sentence = input("Sentence: ")
+
+screen_width = 80
+text_width = len(sentence)
+box_width = text_width + 6
+left_margin = (screen_width - box_width) // 2
+print(left_margin)
+print()
+print(' ' * left_margin + '+' + '-' * (box_width-2) + '+')
+print(' ' * left_margin + '| ' + ' ' * text_width + ' |')
+print(' ' * left_margin + '| ' + sentence + ' |')
@@ -0,0 +1,18 @@
+#!/usr/bin/env python3
+# 成员资格
+href = 'www.baidu.com'
+print('.' in href)
+# Check a user name and PIN code
+database = [
+ ['albert', '1234'],
+ ['dilbert', '4242'],
+ ['smith', '7524'],
+ ['jones', '9843']
+]
+username = input('User name: ')
+pin = input('PIN code: ')
+if [username, pin] in database: print('Access granted')
@@ -0,0 +1,2 @@
+#