中学计算机编程竞赛

    科技2025-03-31  10

    中学计算机编程竞赛

    I have always hated programming. Ever since my first encounter with a computer code in high school, I knew this was something I wouldn’t pursue in the future. I even graduated college barely passing my two programming courses. However, when I was searching for available jobs for BS Mathematics graduates, most of the jobs I wanted required some programming knowledge. Of course I still tried applying because I thought maybe it’s okay since I possessed some of the skill requirements (which are mostly soft skills), but when interviews came, I would shrink into self-consciousness because deep down, I knew I was unqualified for the job. That’s when I realized I have to learn these programming languages.

    我一直讨厌编程。 自从我在高中第一次接触计算机代码以来,我就知道这是我将来不会追求的东西。 我什至毕业于大学,勉强通过了我的两个编程课程。 但是,当我为BS数学专业的毕业生寻找可用的工作时,我想要的大多数工作都需要一些编程知识。 当然,我仍然尝试申请,因为我认为因为我具备一些技能要求(主要是软技能)就可以了,但是当面试到来时,我会陷入自我意识,因为内心深处,我知道自己没有资格工作。 从那时起,我意识到必须学习这些编程语言。

    Fast forward to today, I have now decided to take a path towards data science and turns out, programming is not as scary as I always deemed it to be. Here are two of the interesting things I learned so far:

    时至今日,我现在决定走上数据科学之路,结果证明,编程并不像我一直认为的那样可怕。 这是到目前为止我学到的两个有趣的事情:

    First is using the command line to switch from one directory to another within your computer. To access it, just type cmd on your computer’s search bar and press enter or if you don’t like using your mouse, you can press the windows key and r simultaneously and a box like this will appear at the bottom left of your screen:

    首先是使用命令行从计算机中的一个目录切换到另一个目录。 要访问它,只需在计算机的搜索栏上键入cmd ,然后按Enter键即可;如果您不喜欢使用鼠标,则可以同时按Windows键和r键,这样的框将出现在屏幕的左下方:

    Just type cmd on the space provided, press enter and voila! You have accessed the command line.

    只需在提供的空间上键入cmd ,然后按Enter键,瞧! 您已经访问了命令行。

    Now, maybe you are wondering why it matters to know how to use the command line when we can simply click through different icons in our graphical user interface. That’s because there are certain computer commands that are only accessible through the command line. But for now, what I will show you is changing from one directory to another.

    现在,也许您想知道为什么当我们只需在图形用户界面中单击不同的图标时,知道如何使用命令行很重要。 这是因为某些计算机命令只能通过命令行访问。 但是现在,我将向您展示的是从一个目录更改为另一个目录。

    Once you have entered the command line, what you will see is a black screen with three lines of white text. The third line is the most important because it shows where you currently are in your computer. As you can see in my screen below, the user’s name is CATH because the previous owner of this laptop is named Cath.

    输入命令行后,您将看到一个黑屏,其中包含三行白色文本。 第三行是最重要的,因为它显示了您当前在计算机中的位置。 如您在下面的屏幕中所见,该用户的名称为CATH,因为此笔记本电脑的先前所有者名为Cath。

    Now, let’s try changing directories! We can do it by following the four simple steps below:

    现在,让我们尝试更改目录! 我们可以按照以下四个简单步骤进行操作:

    To switch from the current directory to the desktop directory, just type cd<space>desktop, where cd stands for change directory.

    要从当前目录切换到桌面目录,只需键入cd <space> desktop ,其中cd代表更改目录。

    2. Now that we are in our desktop directory, we can go back from the previous directory by typing cd<space>.. or cd space dot dot and pressing enter.

    2.现在我们位于桌面目录中,我们可以通过键入cd <space> ..或cd space dot dot dot并按Enter键从上一个目录返回。

    3. Also, it is possible to move to two directories in a single line. If I want to go to my WORK folder in my desktop, I will just type cd<space>desktop\work

    3.同样,可以在一行中移至两个目录。 如果要转到桌面上的WORK文件夹,只需键入cd <space> desktop \ work

    Note that I used a backslash symbol to include my second directory.

    请注意,我使用反斜杠符号来包含第二个目录。

    4. Lastly, going back to my original directory, I will just type cd<space>../.. where I now used a slash symbol.

    4.最后,回到我的原始目录,我将只键入cd <space> .. / .. ,现在使用斜杠符号。

    Those are just four out of so many things to learn about command line. As I mentioned earlier, there are certain commands accessible only using the command line.

    这些只是要学习命令行的众多知识中的四分之三。 如前所述,某些命令只能通过命令行访问。

    The next thing I want to share is the Spyder IDE, a scientific programming environment written in the Python language. As you can see in the photo below, there are only three main parts: the code block, the variable explorer, and the python console.

    我想分享的下一件事是Spyder IDE,这是一种用Python语言编写的科学编程环境。 如您在下面的照片中所见,只有三个主要部分:代码块,变量资源管理器和python控制台。

    Basically, the code block is where you write your code, the variable explorer is where the assigned variables and their corresponding value appears, and the python console shows the output of your code. Let us try to write some code.

    基本上,代码块是您编写代码的位置,变量浏览器是分配的变量及其对应值的显示位置,而python控制台则显示代码的输出。 让我们尝试编写一些代码。

    In the photo above, I used the print function in the code block to show the text “Hello!” in the python console. Noticeably, nothing different happened in the variable explorer since I have not assigned a value to any variable yet.

    在上面的照片中,我使用了代码块中的打印功能来显示文本“ Hello!”。 在python控制台中。 值得注意的是,变量浏览器中没有发生任何不同的变化,因为我尚未为任何变量分配值。

    Note: To run your code, just press ctrl+enter or simply click the green play button at the top left (below “Debug”).

    注意:要运行代码,只需按ctrl + enter或简单单击左上角的绿色播放按钮(“调试”下方)。

    Now that I have assigned values to variables x,y and z, it has reflected in the variable explorer. Although, nothing was added to our “Hello!” text in the python console since we did not print anything. Let us try printing z in our next line and see what appears in the python console.

    现在,我已经为变量x , y和z分配了值,它已经反映在变量资源管理器中。 尽管,“ Hello!”没有添加任何内容在python控制台中输入文本,因为我们没有打印任何内容。 让我们尝试在下一行中打印z ,然后查看python控制台中显示的内容。

    If I print “z” including the quotation marks, it treats z as plain text. On the other hand, without the quotation marks, it treats z as a variable.

    如果我打印带有引号的“ z”,它将z视为纯文本。 另一方面,没有引号,它将z作为变量。

    Actually, this Spyder IDE is not completely new to me since we used it in one of my two programming courses. However, it feels like I’m still learning it for the first time since as I mentioned earlier, I used to hate programming. The only difference in learning it now is that I am excited to learn more.

    实际上,这个Spyder IDE对我来说并不完全陌生,因为我们在我的两个编程课程之一中使用了它。 但是,自从我以前讨厌编程以来,感觉就像我还是第一次学习它。 现在学习它的唯一区别是,我很高兴学习更多。

    That is it for now. I hope you enjoyed learning and relearning with me.

    现在就这样。 希望您喜欢与我一起学习和学习。

    翻译自: https://medium.com/@kelsey.lopez/two-things-i-learned-in-computer-programming-6dfffc65a109

    中学计算机编程竞赛

    相关资源:jdk-8u281-windows-x64.exe
    Processed: 0.015, SQL: 8