Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of Modular programming of Python function

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the relevant knowledge of "the method of modular programming of Python function". The editor shows you the operation process through the actual case, and the operation method is simple, fast and practical. I hope this article "the method of modular programming of Python function" can help you solve the problem.

# include

Int main ()

{

Int iChioce

Do

{

Printf ("* 1. Eat\ n")

Printf ("* 2. Sleep\ n")

Printf ("* 3. Beat Doudou\ n")

Printf ("* 0. Exit\ n")

Printf ("* Please select (0-3):")

Scanf ("d", & iChioce)

/ / processing after selection

If (iChioce==1)

Printf ("I eat.\ n")

Else if (iChioce==2)

Printf ("I sleep.\ n")

Else if (iChioce==3)

Printf ("I'll fight.\ n")

Else if (iChioce==0)

Break

Else

{

Printf ("\ 007 selection error!\ n")

Continue

}

Printf ("Congratulations on completing a job!\ n")

}

While (1)

Return 0

}

# include

Int choose ()

Void eat ()

Void sleep ()

Void hitdoudou ()

Int main ()

{

Int iChioce

Do

{

IChioce=choose ()

If (iChioce==1)

Eat ()

Else if (iChioce==2)

Sleep ()

Else if (iChioce==3)

Hitdoudou ()

Else if (iChioce==0)

Break

Else

{

Printf ("\ 007 selection error!\ n")

Continue

}

Printf ("Congratulations on completing a job!\ n")

}

While (1)

Return 0

}

Int choose ()

{

Int i

Printf ("\ n * 1. Eat\ n")

Printf ("* 2. Sleep\ n")

Printf ("* 3. Beat Doudou\ n")

Printf ("* 0. Exit\ n")

Printf ("* Please select (0-3):")

Scanf ("d", & I)

Return i

}

Void eat ()

{

Printf ("I eat.\ n")

}

Void sleep ()

{

Printf ("I sleep.\ n")

}

Void hitdoudou ()

{

Printf ("I'll fight.\ n")

}

This is the end of the introduction of "the method of modular programming of Python function". Thank you for your reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report