Practice Lab: Introduction to Python

실습 14분 universal_currency_alt 무료 show_chart 입문
info 이 실습에는 학습을 지원하는 AI 도구가 통합되어 있을 수 있습니다.
이 콘텐츠는 아직 휴대기기에 최적화되지 않음
최상의 경험을 위해 데스크톱 컴퓨터에서 이메일로 전송된 링크를 사용하여 방문하세요.

Introduction

Python is a high-level, general-purpose programming language. Its design philosophy emphasizes code readability with the use of significant indentation. Python is dynamically typed and garbage-collected. It supports multiple programming paradigms, including structured, object-oriented and functional programming.

You will learn about the Python print() function in this lab. The print() function prints the specified message to the screen, or other standard output device. The message can be a string, or any other object, the object will be converted into a string before written to the screen.

Disclaimer: For optimal performance and compatibility, it is recommended to use either Google Chrome or Mozilla Firefox browsers while accessing the labs.

Setup and requirements

Before you click the Start Lab button

Please go through these directions. The Labs have a time limit and cannot be paused. The timer begins when you click the Start Lab button, shows how long Google Cloud resources will be made available to you.

Green "Start Lab" button

After you click the Start Lab button, you will see an editor and terminal, where you will be performing further steps in the lab. It should looks like this:

Screenshot of ide."

Overview

You are going to finish a series of tasks related to Python programming.

Access pre-created files

  • Click the files icon as shown below to access the pre-created files.

Files

  • Each pre-created file has the prefix task as shown below. You will need to use these files to complete the tasks in the lab.

Assessment Files

What you need

To complete this lab, you need:

  • Access to a standard internet browser (Chrome browser recommended).
  • Knowledge about Python Programming
  • Time to complete the lab.

Task 1

You need to use Python programming to produce the text as an output.

  1. Click the files icon to access the pre-created file.

  2. Open the pre-created task1.py file, by clicking on the file name.

  3. Write the Python command to put My first Python program on the terminal screen.

Note: The three dots (...) indicate where to add the code.

. . . ("My first Python program")
  1. Execute the file by entering the following command in the terminal.
python task1.py

Task 2

Convert the following Bash command into its equivalent Python code.

echo Have a nice day
  1. Click the files icon to access the pre-created file.

  2. Open the pre-created task2.py file, by clicking on the file name.

  3. Write the Python code to put the output on the terminal screen.

  4. Execute the file by entering the following command in the terminal.

python task2.py

Task 3

You need to use Python programming to produce the text as an output into the multiple times.

  1. Click the files icon to access the pre-created file.

  2. Open the pre-created task3.py file, by clicking on the file name.

  3. Write the Python code to put This is fun! on the terminal screen 5 times.

Note: The three dots (...) indicate where to add the code.

for i in range(5): . . . ("This is fun!")
  1. Execute the file by entering the following command in the terminal.
python task3.py

Congratulations!

You have successfully completed the tasks related to Python Programming.

시작하기 전에

  1. 실습에서는 정해진 기간 동안 Google Cloud 프로젝트와 리소스를 만듭니다.
  2. 실습에는 시간 제한이 있으며 일시중지 기능이 없습니다. 실습을 종료하면 처음부터 다시 시작해야 합니다.
  3. 화면 왼쪽 상단에서 실습 시작을 클릭하여 시작합니다.

시크릿 브라우징 사용

  1. 실습에 입력한 사용자 이름비밀번호를 복사합니다.
  2. 비공개 모드에서 콘솔 열기를 클릭합니다.

콘솔에 로그인

    실습 사용자 인증 정보를 사용하여
  1. 로그인합니다. 다른 사용자 인증 정보를 사용하면 오류가 발생하거나 요금이 부과될 수 있습니다.
  2. 약관에 동의하고 리소스 복구 페이지를 건너뜁니다.
  3. 실습을 완료했거나 다시 시작하려고 하는 경우가 아니면 실습 종료를 클릭하지 마세요. 이 버튼을 클릭하면 작업 내용이 지워지고 프로젝트가 삭제됩니다.

현재 이 콘텐츠를 이용할 수 없습니다

이용할 수 있게 되면 이메일로 알려드리겠습니다.

감사합니다

이용할 수 있게 되면 이메일로 알려드리겠습니다.

한 번에 실습 1개만 가능

모든 기존 실습을 종료하고 이 실습을 시작할지 확인하세요.

시크릿 브라우징을 사용하여 실습 실행하기

이 실습을 실행하려면 시크릿 모드 또는 시크릿 브라우저 창을 사용하세요. 개인 계정과 학생 계정 간의 충돌로 개인 계정에 추가 요금이 발생하는 일을 방지해 줍니다.