LING 111 Lecture 15: a8q2txt
Document Summary
No. 1 mistake on first if statement the length of the phone number is 12, so the first if statement should be if len(number) != 12: No2 mistake on the for loop, it should be for in in [0,1,2,4,5,6,8,9,10] because there are number on those posisitions. Department of history" phonenumber 306. 966. 8712 (the phonebook mistake: the first if statement should be if isvalidphonenumber(number): else record[valid] = false. Error: returned false for department of computer science" phonenumber 306-966-4886 (the phone number has correct format) Error: returned false for phonenumber has dots instead of dashes) Error: returned false for department of psychology" phonenumber (306) 966-6657 (the phone number has charactors other than numbers and dashes) Error: returned false for department of history" phonenumber 306. 966. 8712 (cause the second if statement to be true)