基础操作之——tuple基本操作

Tuple1 := [1,2,3,4,5]

Number := |Tuple1|
dev_clear_window()
dev_disp_text('Tuple1 := [1,2,3,4,5]'+'大小为'+Number, 'window', 'center', 'center', 'black','box_color', '#00ffffc0')

 

SingleElement := Tuple1[3]
dev_clear_window()
dev_disp_text('Tuple1 := [1,2,3,4,5]'+'索引值为3的元素为'+SingleElement, 'window', 'center', 'center', 'black','box_color', '#00ffffc0')

 


Part := Tuple1[1:3]
dev_clear_window()
dev_disp_text('Tuple1 := [1,2,3,4,5]'+'截取的元素为'+Part, 'window', 'center', 'center', 'black','box_color', '#00ffffc0')

 


Copy := Tuple1[0:|Tuple1| - 1]
dev_clear_window()
dev_disp_text('Tuple1 := [1,2,3,4,5]'+'拷贝的元素为'+Copy, 'window', 'center', 'center', 'black','box_color', '#00ffffc0')

 

复制代码
Tuple1 := [1,2,3,4,5]

Number := |Tuple1|
dev_clear_window()
dev_disp_text('Tuple1 := [1,2,3,4,5]'+'大小为'+Number, 'window', 'center', 'center', 'black','box_color', '#00ffffc0')

SingleElement := Tuple1[3]
dev_clear_window()
dev_disp_text('Tuple1 := [1,2,3,4,5]'+'索引值为3的元素为'+SingleElement, 'window', 'center', 'center', 'black','box_color', '#00ffffc0')

Part := Tuple1[1:3]
dev_clear_window()
dev_disp_text('Tuple1 := [1,2,3,4,5]'+'截取的元素为'+Part, 'window', 'center', 'center', 'black','box_color', '#00ffffc0')

Copy := Tuple1[0:|Tuple1| - 1]
dev_clear_window()
dev_disp_text('Tuple1 := [1,2,3,4,5]'+'拷贝的元素为'+Copy, 'window', 'center', 'center', 'black','box_color', '#00ffffc0')
View Code
复制代码

 

posted @   echo-efun  阅读(35)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 展开说说关于C#中ORM框架的用法!
点击右上角即可分享
微信分享提示