With the rapid development of science and technology, programming has become a necessary skill.In many programming languages,Python is highly praised for its simplicity, elegance and powerful features.Recently, I took part in a Python training to deeply explore the charm of Python.Next, I will share my training experience and take you to enjoy the wonderful world of Python.
Python training report
Practice content of combined data type
1. Write a function named list_sum to receive a list of numbers and return the cumulative sum of list elements;That is to say, it returns a new list, where the ith element is the sum of the first i+1 elements of the original list.
For example: t=[1,2,3,4,5] Call the function list_sum (t) to return: [1,3,6,10,15]
2. Design a dictionary, use the user input content as the key, and then output the corresponding value. If the input key does not exist in the dictionary, then output "the key you input does not exist".
3. Write a program to generate 50 0-10 random integers and count the number of occurrences of each element.
4. Count the number of leap years from 2000 to 2025.
Through this Python training, I have mastered the basic knowledge and skills of Python and applied what I learned to practical projects.In the future, I will continue to study Python in depth and try to apply it to more fields.Let's join the world of Python and explore more wonderful journeys!
This article is written byxiaowanPublished on October 12, 202315:42:34
This article is collected and sorted by the website of Mutual Benefit, and the email address for problem feedback is:wosnnet@foxmail.com, please keep the link of this article for reprinting:https://wosn.net/19238.html