Go语言基础语法(一)

Python015

Go语言基础语法(一),第1张

本文介绍一些Go语言的基础语法。

先来看一个简单的go语言代码:

go语言的注释方法:

代码执行结果:

下面来进一步介绍go的基础语法。

go语言中格式化输出可以使用 fmt 和 log 这两个标准库,

常用方法:

示例代码:

执行结果:

更多格式化方法可以访问https://studygolang.com/pkgdoc中的fmt包。

log包实现了简单的日志服务,也提供了一些格式化输出的方法。

执行结果:

下面来介绍一下go的数据类型

下表列出了go语言的数据类型:

int、float、bool、string、数组和struct属于值类型,这些类型的变量直接指向存在内存中的值;slice、map、chan、pointer等是引用类型,存储的是一个地址,这个地址存储最终的值。

常量是在程序编译时就确定下来的值,程序运行时无法改变。

执行结果:

执行结果:

Go 语言的运算符主要包括算术运算符、关系运算符、逻辑运算符、位运算符、赋值运算符以及指针相关运算符。

算术运算符:

关系运算符:

逻辑运算符:

位运算符:

赋值运算符:

指针相关运算符:

下面介绍一下go语言中的if语句和switch语句。另外还有一种控制语句叫select语句,通常与通道联用,这里不做介绍。

if语法格式如下:

if ... else :

else if:

示例代码:

语法格式:

另外,添加 fallthrough 会强制执行后面的 case 语句,不管下一条case语句是否为true。

示例代码:

执行结果:

下面介绍几种循环语句:

执行结果:

执行结果:

也可以通过标记退出循环:

--THE END--

小学英语教案是小学英语老师做好教学的关键,为帮助各位老师做好上课前的准备,下面我为大家带来Go straight on英语教案,供各位教师参考!

Go straight on英语教案:

教学目标:

1、培养学生自主参与语言实践活动,在活动中树立 英语学习 的信心,增强学生对英语学习的兴趣。

2、 培养学生听、说、读的能力以及交际的能力。

3、去掌握问路和指路的句型。

教学重点:

To practice the dialogue

教学难点:

Act the dialogues

教学 方法 :

1.情景教学法

2.自主学习 合作探究

教学准备:

多媒体 录音机

教学过程:

一、新课导入

情景导入对话

1.迷路了,怎么办?是否有过问路或是为别人指路的经历。

学习问路的 句子 ,Excuse me,Where is No.2West Lake Road?(说明英语中的地址如何表达)

练习问路的句子

2. 描述方位让学生知道东南西北的单词。

二、听力训练

听录音,看图片

三、对话处理

教师在黑板上画出四条街道,并标出简单的英文名称,分别表“go straight on,turn right,turn ,left”(提醒”where”的用法。

四、学以致用

(一)练习对话,进行巩固。

(二)表演对话。

(三)做游戏

1 传纸团。

2 找礼物。

五、作业设计

1.背诵对话。

2.抄写单词。

3. 做练习册

Go straight on教学设计:

教材简介:

本课教授的是《新标准英语第三册》(三年级起点)第二模块第一单元,教学内容是与方向有关的句子和问路的礼貌用语。

学生分析:

本课学习对象是本校四年级学生,他们活泼上进,有一定的英语基础,喜欢合作学习,有良好的课堂合作学习习惯,能静能动,集体观念较强。

教学目标:

1、知识技能目标:1.会用“Excuse me,where’s…please?”问路。

2、会用“Go straight on.Turn left .Turn righ.”指路。

3、情感目标:培养学生懂礼貌的品质,请别人帮忙要用“Excuse me ”“ please”等礼貌用语。

教学重点:

用英文问路、指路。

教具准备:

课件、一张由学校到自己家的路线图、“Left、 Right” 舞曲影碟

教学理念:

1、教学中要循序渐进,符合学生的认知规律。

2、教学不仅要教书,还要育人,要培养学生良好的学习习惯和行为品质。

3、要引导学生通过感知、体验、实践、参与与合作等方式,实现任务的目标要引导他们学会用语言做事情。

教学过程:

一、Greeting

T:Hi.Boys snd girls.

Ss:Hello.Ms zhao

T:You look happy.How are you today?

Ss:Very well.Thank you .And you?

T:I’m very well.Excuse me,what day is today?

Ss:It’s Friday.

T:Excuse me,what’s the weather like?

Ss:It’s …

二、warmer

1、(Play the video)

T:Boys and girls.Do you like dancing? Good.Stand up ,please.Look and the screen, follow the music , let’s dance .教师在前面示范。

Left.Right.Go.Turn around .Go go go.

Left.Right. Go.Turn around .Go go go.

三、Presentation

1、T talk to S1

T:Excuse me,give me a pencil-box,please?

S1 Pass a pencil-box to T.

2、T pretend to drop the pencil-box.

T:The pencil-box is lost .Where’s my pencil-box ?(Ss poit to it)

3、T:Oh .Go straight on. Turn left .It’s here.Thank you.

4、T:Boys and girls ,now, we’re learning dicretions.

板书Module 2 Directions

Go straight on(画图标)。 Turn left(画图标) .Turn right(画图标)。

四、Learning and pratice

1、Act and say:Go straight on. Turn left .Turn right.

T:(Turn right)

Ss: Go straight on.…

2、Read the three sentences.

3、Contest:listen and act

每大组派一名成员上台,教师发出口令,用上刚才学过的句子。如果学生反应快,教师加快口令的速度,增加游戏的趣味性。两个或多个一组,一人发口令,任务完成后快速坐好。

5、Group show and comments

小组展示,大家评出最佳小组。

先是个别学生评价,“Excuse me,which group is the winner? ”然后统一评价意见。

6、Talk about the text:

T:(Show the picture)This dog is Doudou. He’s lost.(作丢失、不知道在哪儿的动作)。

7、T:Where’s the dog’s house:?Please look at the screen, you will find the answer.

8、播放课件

Look.Sam.This dog is lost.My name is Doudou.I live in No. 2 West Lake Road.

9、S1 tells T where the dog’s house is.

10、Read

No. 2 West Lake Road.

11、Continue to watch the flash

Excuse me,Where’s No. 2 West Lake Road,please?

12、T:Excuse me,Where’s No. 2 West Lake Road,please?( 板书 )Do you know?

如果学生说出答案,教师不要急于表态,引导同学们看课件检查如回答不出,教师鼓励学生认真在课件中寻找答案。

13.Read the sentences

Turn left.Go straight on.Turn right.It’s next to a supermarket.

14.Read in role

A:Excuse me,Where’s No. 2 West Lake Road,please?

B:Turn left.Go straight on.Turn right.It’s next to a supermarket.

把Unit 1课件看完 .

五、task

1.Task 1:SB activity 3:find and say

A:Excuse me,where’s the supermarket ,please?

B:Go straight on…

2.Task 2 :Game

Use a scarf to cover S1’s eyes,the class guide him(her) to find his (her)book(pencil-box)

S:Good morning.May I help you?

S1:Yes.Excuse me,where’s my book,please?

S:Go straight on .Turn left.It’s in the desk.

S1:Thank you so much.

S:You’re welcome.

3、Task 3 :talk about the diretions

Show-pair-class

(1)T:Would you like to go to my house?

If you use “Excuse me,Where’s your house?”to ask me,I would like to tell you the dicretions.

T do the action of answering the call

T:Hello.This is Miss Wang.

S1:Hello.This is …Excuse me,where’s your house?

T:(拿出事先画好的由学校到自己家的路线图)Turn left…It’s next to a bookstore.

S1:Thank you. Bye-bye.

T:See you later.

2)Pair work

T:Welcome to my house.Which classmate’s house you would like to go?

You can ask him(her)the directions,be polite,ok?

3)Ask some Ss to talk in class

Step 6:dance

(Play the video)

T:Boy and girls.Are you tired?Do you want to dance? Ok.Let’s begin.

Activity after class:I’m a polite guide