package main
import"fmt"//定义一个结构体type Book struct{
title string
auth string}funcmain(){var book1 Book
book1.title ="Golang"
book1.auth ="zhang3"
fmt.Println("%v\n",book1)}
结构体传参
package main
import"fmt"//定义一个结构体type Book struct{
title string
auth string}funcchangeBook(book Book){//传递一个book的副本
book.auth ="666"}funcchangeBook3(book *Book){//指针传递
book.auth ="777"}funcmain(){var book1 Book
book1.title ="Golang"
book1.auth ="zhang3"
fmt.Println("%v\n",book1)//副本传递是不会改变结构体的值changeBook(book1)
fmt.Println("副本传递",book1)//指针传递changeBook3(&book1)
fmt.Println("指针传递",book1)}
lenovo联想原装出厂Windows10系统,适用型号:
ThinkPad T14 Gen 2,ThinPad T15 Gen 2,ThinkPad P14s Gen 2,ThinkPad P15s Gen 2
(20W1,20W5,20VY,20W7,20W0,20W4,20VX,20W6)
链接࿱…
一、让用户可以输入信息
创建forms.py 创建基于表单的页面的方法几乎与前面创建网页一样:定义一个 URL ,编写一个视图函数并编写一个模板。一个主要差别是,需要导入包含表单 的模块forms.py 。 from django import forms
from .models impor…