1 ProblemIn recent studies and usage of Python, we encounter emphasis statements in Python, but sometimes we make certain mistakes. For example, we may change the object we want to emphasize, and sometimes errors occur due to improper formatting.2 Method
- Add ‘**kw’ at the end of the listdef key_list(name, gender, age, **kw):
- Start printing the list (be careful to indent four spaces, otherwise it will throw an error)print(‘name:’, name, ‘gender:’, gender, ‘age:’, age, ‘other:’, kw)
- If you do not define anything for **kw, it will print ‘other:{}’
name: Yongbing gender: woman, age: 20 other:{}
3 Conclusion
- Pay attention to the use of ‘**’ in emphasis statements.
- Remember the order of statements after ‘**’.
- Remember to indent four spaces after the colon.