COMP 206 Lecture Notes - Lecture 8: Concatenation, Electronic Industries Alliance, Everytime

63 views12 pages

Document Summary

Quick start: variables don"t have to be declared before use, but obviously they have to be initialized, sub-statements are denoted by a colon (body of an if) If x>1: print x is bigger than 1. : use print to print. Built-in date structures: numbers: integers, floating-point numbers, complex # (# with real and imaginary part), arbitrary long ints. +, -, *, /, ** (exponentiation) , % abs(), floor(), 7 is not greater than 0 is not 7>0: c-style shifting & masking, int division truncates. 1/2 0. 5, float(1)/2 . 5 int/int = int. Strings: s = hello , and are the same, comp 206\nmessing with python today", he said jump and i said how high? ", not an array of characters with null at the end. Methods: like functions associated with a data type (i. e. a class, s = hello , s. upper() hello , s. lower() hello , upper and lower are methods of the string class, positional operators.

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