练习19——函数和变量类型
来源:互联网 发布:js判断是否数组 编辑:程序博客网 时间:2024/05/17 04:56
# -*- coding: utf-8 -*-#19: 函数和变量类型#函数的参数可以是数字(#1),可以是变量(#2),可以进行运算(#3),还可以变量和运算同时存在(#4)def cheese_and_crackers(cheese_count, boxes_of_crackers): print ("You have %d cheeses!" % cheese_count) print ("You have %d boxes of crackers" % boxes_of_crackers) print ("Man that's enough for a party!") print ("Get a blanket.\n")#1print ("We can just give the function numbers directly:")cheese_and_crackers(20, 30)#2print ("Orm we can use varables from our script:")amount_of_cheese = 10amount_of_crackers = 50cheese_and_crackers(amount_of_cheese,amount_of_crackers)#3print ("We can do math in side too:")cheese_and_crackers(10 + 20, 5+ 6)#4print ("And we can combine the two, varables and math:")cheese_and_crackers(amount_of_cheese + 100, amount_of_crackers + 1000)
0 0
- 练习19——函数和变量类型
- static 类型变量和函数
- JS——变量类型和计算
- 复习—基本知识-变量和基本类型
- Go编程基础—类型和变量
- 变量、常量和函数等存储类型
- C变量和函数的存储类型
- C变量和函数的存储类型
- 第二篇:变量类型转换和函数
- 第二章 变量和基本类型——2.3 变量
- C#类型和变量——引用类型
- php的部分变量类型和函数类型
- 数据类型(基本内置类型)——指针和指针孩子(指针变量(指针类型)、数组(构造类型)、字符串、函数指针、空指针等)
- 练习4——变量(variable)和命名
- 练习5——更多的变量和打印
- 变量类型、存储方式、函数声明调用——记录
- 练习35——分支和函数
- 对于静态成员函数和静态成员变量的练习
- Gtk开发小结_控件基础
- java修饰符
- Android 自定义View
- url参数中文乱码问题解决
- 浅谈异常与恋爱
- 练习19——函数和变量类型
- Google 的开源技术protobuf 简介与例子
- Altium Designer高级功能初探之:差分布线
- rabbitmq开启web管理后台
- ListView显示最后一条Item不完整问题分析
- 《Thinkinginjava》第12章-异常处理
- c#中ref与out的区别
- 使用GTK+获取屏幕分辨率并设置满屏显示效果
- js如何判断一个对象是array ,instanceof 是基于什么实现的呢?