Unity3D 新农村小卧室
2025/12/17 14:15:20
Python除了常见的数据结构外,还有一些值得探索的结构。例如,你可以在Python中创建集合(sets)。集合对象的方法很实用,能让你找出同时出现在两个集合中的元素,或者只在某个特定集合中出现的元素。
Python支持许多传统的流程控制语句:
-if语句:
age = 15 if age >= 16: print "you are old enough to drive" elif age == 15: print "you are old enough for a permit" else: print "sorry, you can't drive yet"#!/bin/python age = int(raw_input('Please enter your age: ')) while (age < 0): print "You can't be that young!"; age = int(raw_input('Please enter your age: ')) print