CMPUT174 Lecture Notes - Lecture 4: Operand
ceruleanzebra152 and 30 others unlocked
25
CMPUT174 Full Course Notes
Verified Note
25 documents
Document Summary
Q1 for each of the following python statements, write the type of object that the underlined and bolded expression evaluates to: Statement window = window("remember the word", 500, 400) window. set_font_color("green") icon_width = window. get_string_width("ua") surface_width = window. get_width() 0, 0) str font_height = window. get_font_height() playerword == "chair" window. close() int bool. Q2 use this program segment from remember 2 to answer the questions: if guess == "chair": window. draw_string("congratulations, you are correct. ", 0, 0) else: window. draw_string("sorry, you entered "+ guess, 0, 0) window. draw_string("the answer was chair", 0, font_height) List the kind of each statement in the program segment. if statement, expression. List each keyword in the program segment. if, else. List the types of each object that is used in the program segment. str, bool,method, uagame. window, nonetype, int. List each operator, that is used in the program segment, together with its operand types str == str, str + str.