[鲜花]GitHub Copilot最近又出了个新功能。这一次,它不再是帮你写代码了,而是充当一个“翻译官”:用“人话”告诉你,这段代码到底写了啥。瞧,只需要选中一段代码,然后点一下旁边的“Ask Copilot”,就会快速得到代码的“人话版”解释。
[微笑趣泡]示例中的代码片段是这样的:
if len(l)=0: return Nonelse: max_int=l[0] for i in l if i>max_int max_int=i return max_int
Copilot 对此进行“翻译”后,输出的内容是:
定义一个函数 max_int (),它将一个列表作为输入。
设置一个变量 max_int=l [0],它包含列表中的第一个元素。
设置一个 for 循环,迭代列表中的每个元素。
如果元素大于 max_int,便让 max_int 等于 I。
返回 max_int。
这便是 GitHub Copilot 的最新功能 ——Explain Code。之前 Copilot 是基于人类的注释生成代码,现在好了,它也学会了反向输出。
[微笑趣泡]示例中的代码片段是这样的:
if len(l)=0: return Nonelse: max_int=l[0] for i in l if i>max_int max_int=i return max_int
Copilot 对此进行“翻译”后,输出的内容是:
定义一个函数 max_int (),它将一个列表作为输入。
设置一个变量 max_int=l [0],它包含列表中的第一个元素。
设置一个 for 循环,迭代列表中的每个元素。
如果元素大于 max_int,便让 max_int 等于 I。
返回 max_int。
这便是 GitHub Copilot 的最新功能 ——Explain Code。之前 Copilot 是基于人类的注释生成代码,现在好了,它也学会了反向输出。
《经典基础编程50题_张三与王二麻子-CSDN博客_编程题》第一题:使用for循环,求出1-100之间的奇数之和.public class GetSum { public static void main(String[] args) {int sum=0; for (int i = 1; i <=100; i++) {if(i%2==1){ sum+...https://t.cn/A6JnXdgk
#鲸鱼与洲喵[超话]#Can I laughing to death now ???
on my mind ,I think ,After sending location and share his activity , Sending current situation ,
And suddenly in the middle of the night delete post
Don't said to your husband your are int he bad mood and want to drink water
I'm death I'm death ...
Seeing this funny couple
Is mean darling go home faster I almost finish recording time ,and whale said ,yes coming
no need to delete your video ,mommy ltwsdy save it
Cr. all picture CREDIT TO OWNER
,THANK YUZHOU FANS FOR SHARING AND CARRING
on my mind ,I think ,After sending location and share his activity , Sending current situation ,
And suddenly in the middle of the night delete post
Don't said to your husband your are int he bad mood and want to drink water
I'm death I'm death ...
Seeing this funny couple
Is mean darling go home faster I almost finish recording time ,and whale said ,yes coming
no need to delete your video ,mommy ltwsdy save it
Cr. all picture CREDIT TO OWNER
,THANK YUZHOU FANS FOR SHARING AND CARRING
✋热门推荐