当前位置: 首页 > news >正文

day2: booleans, string interpolation, and checkpoint1

import Cocoa //boolean let goodDogs = true let gameOver = false let isMultiple = 120.isMultiple(of:3) var isAuthenticated = false isAuthenticated = !isAuthenticated //toggle函数:is the same as using the exclamation mark for not just in slightly less code but is surprisingly useful when dealing with complex numbers var game = false game.toggle() //join strings together //one way: join them using plus (operator overloading); this way is wasteful let firstPart = "Hello, " let secondPart = "World!" let geeting = firstPart + secondPart let geetingForPeople = geeting + " Girls and boys!" //another way: a special technique called string interpolation //you can't add integers to string with plus but string interpolation can let name = "Taylor" let age = 26 let message = "Hello, my name is \(name) and I'm \(age) years old." //checkpoint 1 let tem = 10 let fahrenheit = (tem * 9)/5 + 32 print("celsius is \(tem) and fahrenheit is \(fahrenheit)")
http://www.cnnetsun.cn/news/4145823.html

相关文章:

  • 多无人机协同任务规划:从数学建模到算法实战
  • FanControl 完整指南:3 步驯服电脑风扇噪音
  • 泰克2465B模拟示波器深度评测:模拟时代的工程智慧与现代价值
  • 基于多仓群路由算法的中大件海外仓周末选品履约优化方案
  • 2026 游乐空间安装交付服务榜单可以参考哪些选型维度?
  • Yi.Abp.Admin 完整上手指南:从克隆到跑通 5 分钟
  • 开放智能体系统安全实践:从工具调用风险到可信架构设计
  • 蓝天治愈系
  • 最小二乘法:从原理到实践,掌握线性回归的核心算法
  • 数学建模竞赛实战:蒙特卡洛模拟与资源量评价模型解析
  • AI智能体灰盒验证:构建可观测、可测试的Agent质量防线
  • 一步找到全盘文件:EverythingToolbar 任务栏文件搜索完整指南
  • 智慧场馆解决方案小程序系统:从架构设计到实战部署
  • 防火门的耐火极限与哪些因素有关
  • 几何先验驱动视频生成:从3D一致性困境到Geometry-then-Appearance新范式
  • 谷歌TPU与Marvell深度合作:AI芯片变革下的开发者实战指南
  • 智算中心训练任务频繁中断,如何从算力卡查到网络与存储
  • 2026硕博生毕业论文季:多工具协同下的论文全流程处理方案
  • Iwara4A:免费 Iwara 安卓客户端完整指南
  • 数学建模竞赛实战:从问题解析到模型构建与求解全流程指南
  • Spring面试核心:IoC与AOP深度解析与实战
  • GPT2-Chinese 快速上手指南:中文 GPT-2 文本生成训练工具
  • 华为eNSP安装全攻略:解决VirtualBox兼容与40/41错误
  • 基于最近电平逼近的开环MMC逆变器附Simulink仿真模型
  • phi-plugin:面向 YunzaiBot 的 Phigros 一站式成绩查询插件
  • 5分钟装好秒传链接提取脚本:百度网盘秒传完整指南
  • Deepin App Store 安装教程:从零到源码编译只需 4 步
  • MetaClaw:基于持续元学习的智能体进化架构与实践
  • 免费图片去重完整指南:AntiDupl.NET 十分钟扫出上千张相似图
  • 完全不会写开题报告,有哪些 好用的AI论文写作工具推荐?