Java知识分享网 - 轻松学习从此开始!    

Java知识分享网

Java1234官方群25:java1234官方群17
Java1234官方群25:838462530
        
SpringBoot+SpringSecurity+Vue+ElementPlus权限系统实战课程 震撼发布        

最新Java全栈就业实战课程(免费)

springcloud分布式电商秒杀实战课程

IDEA永久激活

66套java实战课程无套路领取

锋哥开始收Java学员啦!

Python学习路线图

锋哥开始收Java学员啦!
当前位置: 主页 > Java文档 > Python技术 >

《1000 Examples Programming In Python》1000个Python编程示例 PDF 下载


分享到:
时间:2024-04-20 14:19来源:http://www.java1234.com 作者:转载  侵权举报
《1000 Examples Programming In Python》1000个Python编程示例
失效链接处理
《1000 Examples Programming In Python》1000个Python编程示例 PDF 下载 

 
 
 
相关截图:
 

主要内容:

Exercise: Standard Input
In the previous exercises we expected the
userinput to come in on the “Standard Input” aka.
STDIN.
If you would like to practice this more, come up
with other ideas, try to solve them and tell me
about the task. (in person or via e-mail.)
(e.g. you could start building an interactive role
playing game.)
 
Solution: Area of rectangular
 
1 def main():
2 #length = 10
3 #width = 3
4
5 length = int(input('Length: '))
6 width = int(input('Width: '))
7
8 if length <= 0:
9 print("length is not positive")
10 return
11
12 if width <= 0:
13 print("width is not positive")
14 return
15
16 area = length * width
17 print("The area is ", area)
18
19 main()

 

 

 
 
------分隔线----------------------------

锋哥公众号


锋哥微信


关注公众号
【Java资料站】
回复 666
获取 
66套java
从菜鸡到大神
项目实战课程

锋哥推荐