最新发布第13页
排序
Day 10 – 函数输出
单返回值 函数通过 return 关键字,进行函数的输出。 def function_name(input_parameter): <body of function that uses input_argument> return output 示例代码 def format_name(f_nam...
Day 11 – 21点(黑杰克)
游戏介绍 黑杰克(英语:Blackjack),是使用扑克牌玩的赌博游戏。游戏目标是将选手的卡片计数添加到最大而不超过21。纸牌的计数规则:A可作1或11点,2-10作该牌之点数,J、Q、K作10点。 代码实...
Day 16 – 面向对象编程(OOP)
面向对象编程(Object Oriented Programming, OOP),模拟事物为对象(Object),每个对象都有自己的属性(attribute)以及方法(methods)。 对象与类 在 OOP 中,有类(Class)以及对象(Obje...
Day 18 – Turtle 与 GUI
绘制正方形 利用turtle进行正方形的绘制 # 导入模块 import turtle for i in range(4): turtle.forward(100) turtle.left(90) my_screen = turtle.Screen() # 点击屏幕推出GUI界面 my_screen.ex...
How to convert an AsyncSequence into a Sequence 如何将 AsyncSequence 转换为 Sequence
Swift does not provide a built-in way of converting an AsyncSequence into a regular Sequence, but often you’ll want to make this conversion yourself so you don’t n...
How to make parts of an actor nonisolated 如何使 actor 的各个部分非隔离
All methods and mutable properties inside an actor are isolated to that actor by default, which means they cannot be accessed directly from code that’s external to the actor. Acce...
What is actor reentrancy and how can it cause problems? 什么是 actor 重入性,它如何导致问题?
Actor-isolated functions are reentrant, which means it's possible for one piece of work to begin before a previous piece of work completes. This opens the possibility of subtle bug...
Activity 生命周期
Activity 的生命周期,如下图所示 onCreate() 调用时机:当 Activity 第一次被创建 时调用(只会调用一次)。常用操作:• 初始化界面(调用 setContentView() 加载布局)• 初始化数据、变量、...
Widgets
CheckBox 复选框的样式 <CheckBox android:id='@+id/check_box' android:layout_width='0dp' android:layout_height='wrap_content' android:layout_marginTop='101dp' android:text='苹果🍎...





