lambda的使用

lambda 参数行: 语句及返回值

基本上它就是一个匿名函数的定义,如果没有特别把它赋值给一个变量,那么它在定义完毕之后是没有名字的,可以用于“用完即丢”的场合。

s = [2,  4, 5, 7,  5, 4]
for bar in map(lambda n: "*"*n,  s):
	print(bar)
**
****
*****
*******
*****
****
with open("chinadialy.txt", "r", encoding= "utf-8") as f:
    chinadaily = f.readlines()
for line in chinadaily:
    print(line, end = "")
http://www.chinadaily.com.cn/a/202304/14/WS6438ac6da31057c47ebba126.html
Hainan expo impresses, connects foreign visitors to China
Foreign visitors were dazzled by exhibits from home and abroad at a consumer products expo which is being held in Haikou, South China Hainan province.
The third China International Consumer Products Expo runs until Saturday. Exhibitors representing over 3,300 brands from 65 countries and regions attended the fair.
Toby Symonds, a British writer and vlogger who is on the "A Date with China" international media tour, said the expo is a great opportunity to share all wonderful brands not just from China, but across the world.
Ameen Muneer Mohammed, a journalist from China Arab TV, said the expo is a bridge to help foreign enterprises enter Hainan and the vast Chinese market.
http://www.chinadaily.com.cn/a/202304/14/WS64388269a31057c47ebba00d.html
Ten photos from across China: April 7 - 13

   Shoppers select fruits and vegetables at a unique produce stand in Beijing's Chaoyang district on April 7. The store was converted from a retired city bus. Beijing Public Transport Group plans to retrofit at least 300 similar ones in the next three years, covering most areas within the Fifth Ring Road of the capital. [Photo by Wu Changqing/For China Daily] 
 
http://www.chinadaily.com.cn/a/202304/14/WS64388a78a31057c47ebba022.html
Young workers cast off big-city shackles
Digital nomads broaden their employment opportunities
An increasing number of young people in large Chinese cities are choosing to become so-called digital nomads in the hope of striking a better work-life balance by operating remotely.
Using smartphones and computers, digital nomads typically have no fixed business address and often work in various cities and countries. They operate from coffee shops, public libraries and shared office spaces, with some even working from recreational vehicles.
Zhang Le, 37, a former oil engineer from the Inner Mongolia autonomous region, had long wanted to become a digital nomad after reading The 4-Hour Workweek by entrepreneur and author Tim Ferriss in 2009. The opportunity to change his career came in 2015, when Zhang launched a content creation venture.
When COVID-19 emerged in 2020, Zhang visited several Latin American countries and also lived in Turkiye for a year.
"The biggest advantages I have gained from being a digital nomad are geographical freedom and gradually discovering the meaning of life by abandoning the traditional work-life balance to pursue jobs that I want to do," said Zhang, who graduated from the University of Alberta in Canada, where he studied petroleum geoscience.
In 2015, he began publishing articles about digital nomads on his website and on WeChat.
Zhang now operates Digital Nomad Tribe, or DNT, a content brand/paid community themed around the digital nomad lifestyle. DNT, which boasts more than 1,500 paying members, is the largest and longest-running community of its kind in China.
"In modern society, people tend to define everything through their work mentality. They introduce themselves through job descriptions, judge social status based on a person's occupation, and compromise lifestyle choices to fit their careers," said Zhang, who worked remotely and traveled to 30 countries in the past eight years.
"However, digital nomadism is all about moving away from the mindset that our careers should define our lifestyles."
Zhang's daily work schedule is not strictly defined, but mainly involves reading, collecting and sharing information related to digital nomads. He also conducts field visits to digital nomad destinations, writes reports about his experiences, shares book notes, interacts with community members, and answers related questions.
As a digital nomad, Zhang doesn't need to waste time commuting, but he makes better use of his money to escape overcrowded urban areas for more scenic, cost-effective locations. He also has more time to spend with family and friends, and to pursue personal interests.
"I believe that the main premise of the digital nomad lifestyle is a deep reflection of contemporary work culture. Many young people are choosing to reassess the meaning of their existence before they reach middle age by taking control of their lives," said Zhang, who plans to continue exploring his interests and discovering new places without returning to full-time work.
In October, the 2022 Employment Relationship Trend Report published jointly by the National Development Research Institute at Peking University and the human resources website Zhaopin.com showed that just over 76 percent of the post-00s generation were willing to become digital nomads.
Yu Hai, a sociology professor at Fudan University in Shanghai, said: "By embracing this lifestyle, people are seeking to escape the traditional office environment to enjoy more flexibility and freedom in their professional lives. As this trend continues to gain traction, it is poised to have a significant impact on China's job market and economy."
The term "digital nomad" was first coined in 1997 by Jiro Makino, the former CEO of Hitachi, who predicted that advances in network communication technology would free people from working in a specific geographic location.
Makino said thousands of people would become modern-day nomads, migrating from place to place, and living and working on the move, as their ancestors did.
This vision has become a reality, with the digital nomad organization DNX Global estimating that by 2035, 1 billion people worldwide will have adopted such a lifestyle.
The 2021 Digital Nomad Report released by independent workforce management platform MBO Partners showed the number of digital nomads in the United States rose from 7.3 million in 2019 to 11.5 million in 2021. They work in fields such as information technology, creative services, education and training, consulting, research, sales and marketing, public relations, finance and accounting, among others.
These fields can be partially or entirely accessed remotely.

   Zhang Le (bottom) operates Digital Nomad Tribe, a content brand/paid community themed around the digital nomad lifestyle. CHINA DAILY 
 
http://www.chinadaily.com.cn/a/202304/14/WS643884c0a31057c47ebba013.html
Top 10 Chinese firms in new economy
China Enterprise Evaluation Association released 2022 China Top 500 New Economy on April 4, a ranking showing that in 2022, the gross revenue of top 500 strongest Chinese enterprises focusing on new economy exceeded 20 trillion yuan ($2.90 trillion), up 24.13 percent year-on-year, 10 percentage points higher than that of 500 strongest Chinese firms and 15 percentage points higher than that of top 500 Chinese private firms over the same time.
Let's take a look at the top 10 Chinese firms in new economy.
with open("chinadialy.txt", "r", encoding= "utf-8") as f:
    chinadaily = f.readlines()

content_chinadaily = map(lambda line: line.strip().replace(".","> "), chinadaily)
for content_of_chinadaily in content_chinadaily:
    print(content_of_chinadaily)
http://www> chinadaily> com> cn/a/202304/14/WS6438ac6da31057c47ebba126> html
Hainan expo impresses, connects foreign visitors to China
Foreign visitors were dazzled by exhibits from home and abroad at a consumer products expo which is being held in Haikou, South China Hainan province> 
The third China International Consumer Products Expo runs until Saturday>  Exhibitors representing over 3,300 brands from 65 countries and regions attended the fair> 
Toby Symonds, a British writer and vlogger who is on the "A Date with China" international media tour, said the expo is a great opportunity to share all wonderful brands not just from China, but across the world> 
Ameen Muneer Mohammed, a journalist from China Arab TV, said the expo is a bridge to help foreign enterprises enter Hainan and the vast Chinese market> 
http://www> chinadaily> com> cn/a/202304/14/WS64388269a31057c47ebba00d> html
Ten photos from across China: April 7 - 13

Shoppers select fruits and vegetables at a unique produce stand in Beijing's Chaoyang district on April 7>  The store was converted from a retired city bus>  Beijing Public Transport Group plans to retrofit at least 300 similar ones in the next three years, covering most areas within the Fifth Ring Road of the capital>  [Photo by Wu Changqing/For China Daily]

http://www> chinadaily> com> cn/a/202304/14/WS64388a78a31057c47ebba022> html
Young workers cast off big-city shackles
Digital nomads broaden their employment opportunities
An increasing number of young people in large Chinese cities are choosing to become so-called digital nomads in the hope of striking a better work-life balance by operating remotely> 
Using smartphones and computers, digital nomads typically have no fixed business address and often work in various cities and countries>  They operate from coffee shops, public libraries and shared office spaces, with some even working from recreational vehicles> 
Zhang Le, 37, a former oil engineer from the Inner Mongolia autonomous region, had long wanted to become a digital nomad after reading The 4-Hour Workweek by entrepreneur and author Tim Ferriss in 2009>  The opportunity to change his career came in 2015, when Zhang launched a content creation venture> 
When COVID-19 emerged in 2020, Zhang visited several Latin American countries and also lived in Turkiye for a year> 
"The biggest advantages I have gained from being a digital nomad are geographical freedom and gradually discovering the meaning of life by abandoning the traditional work-life balance to pursue jobs that I want to do," said Zhang, who graduated from the University of Alberta in Canada, where he studied petroleum geoscience> 
In 2015, he began publishing articles about digital nomads on his website and on WeChat> 
Zhang now operates Digital Nomad Tribe, or DNT, a content brand/paid community themed around the digital nomad lifestyle>  DNT, which boasts more than 1,500 paying members, is the largest and longest-running community of its kind in China> 
"In modern society, people tend to define everything through their work mentality>  They introduce themselves through job descriptions, judge social status based on a person's occupation, and compromise lifestyle choices to fit their careers," said Zhang, who worked remotely and traveled to 30 countries in the past eight years> 
"However, digital nomadism is all about moving away from the mindset that our careers should define our lifestyles> "
Zhang's daily work schedule is not strictly defined, but mainly involves reading, collecting and sharing information related to digital nomads>  He also conducts field visits to digital nomad destinations, writes reports about his experiences, shares book notes, interacts with community members, and answers related questions> 
As a digital nomad, Zhang doesn't need to waste time commuting, but he makes better use of his money to escape overcrowded urban areas for more scenic, cost-effective locations>  He also has more time to spend with family and friends, and to pursue personal interests> 
"I believe that the main premise of the digital nomad lifestyle is a deep reflection of contemporary work culture>  Many young people are choosing to reassess the meaning of their existence before they reach middle age by taking control of their lives," said Zhang, who plans to continue exploring his interests and discovering new places without returning to full-time work> 
In October, the 2022 Employment Relationship Trend Report published jointly by the National Development Research Institute at Peking University and the human resources website Zhaopin> com showed that just over 76 percent of the post-00s generation were willing to become digital nomads> 
Yu Hai, a sociology professor at Fudan University in Shanghai, said: "By embracing this lifestyle, people are seeking to escape the traditional office environment to enjoy more flexibility and freedom in their professional lives>  As this trend continues to gain traction, it is poised to have a significant impact on China's job market and economy> "
The term "digital nomad" was first coined in 1997 by Jiro Makino, the former CEO of Hitachi, who predicted that advances in network communication technology would free people from working in a specific geographic location> 
Makino said thousands of people would become modern-day nomads, migrating from place to place, and living and working on the move, as their ancestors did> 
This vision has become a reality, with the digital nomad organization DNX Global estimating that by 2035, 1 billion people worldwide will have adopted such a lifestyle> 
The 2021 Digital Nomad Report released by independent workforce management platform MBO Partners showed the number of digital nomads in the United States rose from 7> 3 million in 2019 to 11> 5 million in 2021>  They work in fields such as information technology, creative services, education and training, consulting, research, sales and marketing, public relations, finance and accounting, among others> 
These fields can be partially or entirely accessed remotely> 

Zhang Le (bottom) operates Digital Nomad Tribe, a content brand/paid community themed around the digital nomad lifestyle>  CHINA DAILY

http://www> chinadaily> com> cn/a/202304/14/WS643884c0a31057c47ebba013> html
Top 10 Chinese firms in new economy
China Enterprise Evaluation Association released 2022 China Top 500 New Economy on April 4, a ranking showing that in 2022, the gross revenue of top 500 strongest Chinese enterprises focusing on new economy exceeded 20 trillion yuan ($2> 90 trillion), up 24> 13 percent year-on-year, 10 percentage points higher than that of 500 strongest Chinese firms and 15 percentage points higher than that of top 500 Chinese private firms over the same time> 
Let's take a look at the top 10 Chinese firms in new economy> 

你可能感兴趣的:(java,开发语言)