CAS CS 111 Study Guide - Final Guide: Control Order, 5,6,7,8, File Descriptor
cherryberry1035 and 38883 others unlocked
48
CAS CS 111 Full Course Notes
Verified Note
48 documents
Document Summary
// int division always produces a float result does not round, throws away decimal. % modulus: gives the remainder of a division: data types integer float string ex. 451 if both of the operands are ints, the result is an int ex. 3. 1416 if at least one of the operands is a float, the result is a float ex. Hello : variables allow us to store a value for later use. P" has an index of 0 or -5. Y" has an index of 4 or -1: string operations indexing string[index, >>> name = picobot", >>> name[1, >>> name[-3] Pico" concatenation string1 + string2: >>> word = program", >>> plural = word + s", >>> plural. Programs" duplication string * num_copies: >>> ho!" * 3. Ho!ho!ho!" determining the length len(string: >>> name = perry", >>> len(name, >>> len( ") 0 skip-slicing string[start:end:stride_length: >>> s = boston university terriers", >>> s[0:8:2]