Python 3.1 Study notes 1: What a simple function can tell.

Python is becoming(probably it has been) one of the most popular languages. As a C++ developer, I want to write simple toolkits with a script language on a much-more light-weight level. Python seems to be a good choice with its powerful API libraries.

 

After going through the first 7 chapters of the tutorial, python has 2 different points from other main developing languages,

1. Statement grouping is done by indentation instead of beginning and ending brackets "{}".

2. No variable or argument declarations are necessary.

 

There are 2 ways to enter the interactive mode of python,

1. Typing python in the cmd window.

2. Start up IDLE which is the GUI of python.

Mainly we can get the same result from both of them, but they have some difference in details.

 

I'm used to typing my code in IDLE unless some effect can not be achieved according to the tutorial.

The first easy function in python is,

It contains a lof of information to the basic syntax and grammar,

1. def is used to define a function.

2. the function argument is not give an explicit type.

3. the "=" can be used as vector expression.

4. "()" is not needed in a "while" loop(so is other flow control syntax, such as "if", "for" etc.).

5. ":" is essential for write a sub-block of code.

6. format print is possible in sys function "print".

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
当你安装了Python 3.10.4并在PyCharm中设置后,出现"unsupported Python 3.1"的报错是因为你所使用的PyCharm版本较低。 这个问题可以通过两种解决方案来解决。一种是降低Python环境的版本,取消使用3.10,改用3.7或者3.8等较低版本。另一种是下载较高版本的PyCharm。 如果你必须使用Python 3.10,那么你可以选择卸载PyCharm 2019并安装一个较高版本的PyCharm。 这样,当你安装并打开较高版本的PyCharm后,它将能够识别Python 3.10环境,从而解决了"unsupported Python 3.1"的报错问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [pycharm unsupported Python 3.1](https://blog.csdn.net/chanelwtt/article/details/123848162)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* *3* [pycharm unsupported Python 3.1报错:pycharm无法识别python 3.10](https://blog.csdn.net/weixin_44346972/article/details/129658688)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值