I&C SCI 33 Lecture Notes - Lecture 2: Newline, Short Circuit

46 views4 pages

Document Summary

Iterable: standard python data structures: str, list, tuple, set, dict, for general iterable arguments (not the above mentioned data sructures) we cannot call len nor index them. 15} for c in sorted(votes_dict): print("candidate",c,"received",votes_dict[c],"votes") --> prints sorted by key print(votes_dict) There is no first/minimum i such that the characters are different; len(x) < len(y) so x < y. There is no first/minimum i such that the characters are different; len(x) == len(y) so x == y. i show this example, which is trivial, just to be complete: all digits < all upper-case letters < all lower-case letters. The print function: end and sep parameters change how things are printed. End is whatever is printed at the end of a line, default is "\n", the newline character. Sep is whatever is printed between each printed statement, default is " ", a space. print(1,2,3,4,sep=" ",end="/") print(5,6,7,8,sep="x",end="**") --> prints 1--2--3--4/5x6x7x8**

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents