上游充通大 ParisTech SHANGHAI JIAO TONG UNIVERSITY INSTITUT DES SCIENCES ET TECHNOLOGIES PARIS INSTITUTE OF TECHNOLOGY Computational Thinking and Approach Lecture 3 Dr.Jialiang LU Jialiang.lu@situ.edu.cn
Computational Thinking and Approach Lecture 3 Dr. Jialiang LU Jialiang.lu@sjtu.edu.cn 1
上游充通大 ParisTech SHANGHAI JIAO TONG UNIVERSITY INSTITUT DES SCIENCES ET TECHNOLOGIES PARIS INSTITUTE OF TECHNOLOGY Strings,lists and file objects CONDITIONALS AND SEQUENCES 2
CONDITIONALS AND SEQUENCES Strings, lists and file objects 2
上游充通大 ParisTech SHANGHAI JIAO TONG UNIVERSITY INSTITUT DES SCIENCES ET TECHNOLOGIES PARIS INSTITUTE OF TECHNOLOGY Out ines ·Boolean expressions 。Conditionals -Simple decisions -Chained conditionals Nested conditionals ·Sequences -Strings Lists ·File objects 3
Outlines • Boolean expressions • Conditionals – Simple decisions – Chained conditionals – Nested conditionals • Sequences – Strings – Lists • File objects 3
上游充通大 ParisTech SHANGHAI JIAO TONG UNIVERSITY INSTITUT DES SCIENCES ET TECHNOLOGIES PARIS INSTITUTE OF TECHNOLOGY Build-in Types 。Numbers: int,long float bool complex o Sequences: -str list,tuple ·Mappings: dict 4
Build -in Types • Numbers: – int, long – float – bool – complex • Sequences: – str – list,tuple • Mappings: – dict 4
上游通大¥ ParisTech SHANGHAI JIAO TONG UNIVERSITY INSTITUT DES SCIENCES ET TECHNOLOGIES PARIS INSTITUTE OF TECHNOLOGY Boolean expressions 。True of False With relational operators Applied on string type as well Python Mathematics Meaning < < Less than <= ≤ Less than or equal to 三三 = Equal to >= 2 Greater than or equal to > > Greater than != 卡 Not equal to 5
Boolean expressions • True of False • With relational operators – Applied on string type as well 5