100% tevredenheidsgarantie Direct beschikbaar na je betaling Lees online óf als PDF Geen vaste maandelijkse kosten 4,6 TrustPilot
logo-home
College aantekeningen

CSCA08 Lecture Notes (1-12) and PCRS Example Questions and Answers

Beoordeling
-
Verkocht
1
Pagina's
9
Geüpload op
15-10-2021
Geschreven in
2019/2020

CSCA08 Lecture Notes (1-12) and PCRS Example Questions and Answers

Instelling
Vak









Oeps! We kunnen je document nu niet laden. Probeer het nog eens of neem contact op met support.

Geschreven voor

Instelling
Studie
Vak

Documentinformatie

Geüpload op
15 oktober 2021
Aantal pagina's
9
Geschreven in
2019/2020
Type
College aantekeningen
Docent(en)
Anya tafliovich
Bevat
Alle colleges

Onderwerpen

Voorbeeld van de inhoud

Lecture Jan 7, 2020
● Syllabus, PCRS, and general introductions
Lecture 02
● Terminology
○ 1+2
■ Operators = +
■ Operands = 1, 2
○ -3
■ Operator = -
■ Operand = 3
● Order of arithmetic precedence
○ ()
○ **
○ - (negative sign)
○ *, /, //, %
○ -, +
● Python documentation
○ Ex. round(number, ndigits=None)
■ Round = function
■ Number = first argument
■ Ndigits = second argument
■ = None
● If the second argument is provided, round will use the provided argument.
Otherwise, round will use the value None for the second argument
● Ex. round(42.54335, 2) = 42.54
● Ex. round(42.54335) = 43
● Ex. round(1234.5678, -2) = 1200.0
PCRS Jan 15, 2020
● Argument = values given
○ Ex. data = 3
data2 = 7.5
result = min(data, data2)
● Parameters = values not given
○ Ex. def f(data):
return data * 0.5
Lecture 03 Tues Jan 14, 2020
● Terminology
○ x=1
■ x has gets 1
■ x refers to the value of 1
■ x has a memory address of id1
■ memory address id1 is stored in variable
● Naming variables
○ Starts with a letter or underscore only
○ Contains only letters, digits, or underscores
○ Case sensitive
PCRS Weds Jan 15, 2020
● Function design recipe
○ Examples
○ Header

, ○ Description
○ Body
○ Test
Lecture 04 Thurs Jan 16, 2020
● Midterm expected for first week of february
● Worksheet “Function Design Recipe”
○ Strings always have quotes
○ print(‘yes \n no’)
yes
no
○ print(‘yes \’ no’)
■ yes ‘ no
○ repeat_word(‘smiles’, 0)
■ ‘’
Lecture 05 Tues Jan 21, 2020
● Python considers strings as values too, when it comes to strings
○ Dictionary order
■ ‘abs’ < ‘bsd’
True
■ ‘bs’ <= ‘asd’
False (python evaluates one character at a time, b with a, then s with s)
■ ‘B’ <= ‘a’
True (all lowercase letters come before all uppercase letters)
■ ‘’ < ‘b’
True (empty strings come before all lowercase and all uppercases)
● Priority
○ Arithmetic functions and amounts (greater, less than, etc.) are evaluated left to right
■ Ex. 1 + 1 == 2
True (better to write as (1 + 1) == 2)
● Boolean Operators
○ Priority = Not > Or > And (NOA)
○ And
■ True and True = True
■ T and F = F
■ F and F = F
■ F and T = F
○ Or
■ T or T = T
■ T or F = T
■ F or F = F
■ F or T = T
○ Not

○ Evaluating Left to Right
■ As long as there aren’t any syntax error, it can return an answer. If items are undefined
or don’t make sense, it does not evaluate
● Ex. True and not not not False or (1 + 3) >= Kaveh
True
● If statements
○ Only one “if” and “else”, and an unlimited amount of “elif” in the middle.

Maak kennis met de verkoper

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
StudentUofT UofT
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
49
Lid sinds
4 jaar
Aantal volgers
6
Documenten
52
Laatst verkocht
1 maand geleden
UofT LifeSci and Bird Courses

5,0

4 beoordelingen

5
4
4
0
3
0
2
0
1
0

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Veelgestelde vragen