上一页 1 ··· 348 349 350 351 352 353 354 355 356 ··· 407 下一页
摘要: 1、求两个数中的较大值 #include <stdio.h> int main(void) { int i,j,max; puts("please input two integers"); printf("i = "); scanf("%d", &i); printf("j = "); scanf 阅读全文
posted @ 2021-03-13 18:25 小鲨鱼2018 阅读(216) 评论(0) 推荐(0)
摘要: 1、 #include <stdio.h> int main(void) { int a, b; puts("please input two integer."); printf("a = "); scanf("%d", &a); printf("b = "); scanf("%d", &b); 阅读全文
posted @ 2021-03-13 14:29 小鲨鱼2018 阅读(1368) 评论(0) 推荐(0)
摘要: 1、 #include <stdio.h> int main(void) { double i, j; puts("please input two float type value."); printf("i = "); scanf("%lf", &i); ## double类型的变量通过scan 阅读全文
posted @ 2021-03-13 11:32 小鲨鱼2018 阅读(2433) 评论(0) 推荐(0)
摘要: 1、获取变量的最后一位数字 #include <stdio.h> int main(void) { int i; puts("please input an integer."); printf("i = "); scanf("%d", &i); printf("The last number of 阅读全文
posted @ 2021-03-13 10:23 小鲨鱼2018 阅读(4018) 评论(0) 推荐(0)
摘要: 1、创建module1.py模块 def fun1(x): print(x.upper()) def fun2(x): print(x.title()) def fun3(x): print("--",x) 2、导入module1中的所有函数 >>> fun1("aaaa") Traceback ( 阅读全文
posted @ 2021-03-12 19:50 小鲨鱼2018 阅读(475) 评论(0) 推荐(0)
摘要: 1、将函数fun1、fun2和fun3存储在名称为module1.py的模块中 def fun1(x): print(x.upper()) def fun2(x): print(x.title()) def fun3(x): print(x) 2、导入module1.py模块,使用as为其指定别名为 阅读全文
posted @ 2021-03-12 19:36 小鲨鱼2018 阅读(182) 评论(0) 推荐(0)
摘要: 1、将三个函数fun1\fun2\fun3存储在名称为module1.py的模块中 def fun1(x): print(x.upper()) def fun2(x): print(x.title()) def fun3(x): print(x) 2、给函数fun1指定别名abc. >>> abc( 阅读全文
posted @ 2021-03-12 19:19 小鲨鱼2018 阅读(312) 评论(0) 推荐(0)
摘要: 1、将函数存储在模块里 def fun1(x): ## 在模块module1.py中定义三个函数 print(x.upper()) def fun2(x): print(x.title()) def fun3(x): print(" ",x) 2、测试能否直接调用函数 >>> fun1("aaa") 阅读全文
posted @ 2021-03-12 18:08 小鲨鱼2018 阅读(294) 评论(0) 推荐(0)
摘要: 将函数存储在模块中,在主程序中调用模块。 1、将函数存储在模块中 def fun1(x): ## 函数1 print(x.upper()) def fun2(x): ## 函数2 print(x.title()) def fun3(x): ## 函数3 print(x) 保存为module1.py 阅读全文
posted @ 2021-03-12 17:28 小鲨鱼2018 阅读(394) 评论(0) 推荐(0)
摘要: import语句允许在当前运行的程序文件中使用模块中的代码。 要让函数是可导入的,得先创建模块。模块是扩展名为.py的文件。 1、创建module1,命名module1.py,定义三个函数fun1、fun2、fun3 def fun1(x): print("11111",x) def fun2(x) 阅读全文
posted @ 2021-03-11 16:25 小鲨鱼2018 阅读(270) 评论(0) 推荐(0)
上一页 1 ··· 348 349 350 351 352 353 354 355 356 ··· 407 下一页