专业英语笔记(Install and Use PyCharm)

本文回忆了作者初学编程的经历,并介绍了如何使用Python编写一个简单的猜数字游戏。文章引导读者从零开始设置开发环境,使用PyCharm进行编程,并解释了输入输出及基本运算的实现。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

This time we will try to write a python program: number-guessing game.

Every programmer has a story about how they learned to write their first program. I started learning as a child when my father was working for Digital Equipment Corporation, one of the pioneering companies of the modern computing era. I wrote my first program on a kit computer my dad had assembled in our basement. The computer consisted of nothing more than a bare motherboard connected to a keyboard without a case, and it had a bare cathode ray tube for a monitor. My initial program was a simple number guessing game, which looked something like this:

I'm thinking of a number! Try to guess the number I'm thinking of: 25
Too low! Guess again: 50
Too high! Guess again: 42
That's it! Would you like to play again? (yes/no) no
Thanks for playing!


There are some good IDEs for Python development, such as Geany and PyCharm.
Here we are going to use PyCharm as the IDE to write Python programs.
First download PyCharm from its official website: http://www.jetbrains.com/products.html#lang=python

Click the DOWNLOAD button:


Here we choose the Community Edition and click the DOWNLOAD button:




Double click the installer file and enter the installation wizard:


Click the Next button:


Here we don't change the destination folder and use the default value.








Customize Pycharm as follows:








Create a Python package named net.hw.test in this project.




Now we create a new Python program named addition.py.




Now we can write codes in this file.

The return value of input() function is of str type, so we have to use int() function to convert string to integer.

sum = a + b

Math English: sum equals a plus b  or  sum is equal to a plus b

Computer English: Let sum be equal to a plus b.  |  Assign a plus b to sum.



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

酒城译痴无心剑

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值