Question at position 9 If the missing lines are filled in correctly, the program should continuously ask the user for their student ID until they enter the correct one. Below is an example output of the program, where bolded text is input to the program: Student ID: 725120281Did not match.Student ID: 291854102Did not match.Student ID: 123456789Student ID matches! [table] 1 student_id = 1234567892 attempt = int(input('Student ID: '))3 4 while attempt != student_id:5 # ( code WILL go inside WHILE )6 # …7 # …8 9 print('Student ID matches!') [/table] Which of the following options is the correct missing code?5 attempt = int(input('Student ID: '))6 print('Did not match.')5 attempt = int(input('Student ID: '))6 if attempt != student_id:7 print('Did not match.')5 print('Did not match.')6 if attempt == student_id:7 break5 print('Did not match.')6 attempt = int(input('Student ID: '))Clear my selection单项选择题
A
5 attempt = int(input('Student ID: ')) 6 print('Did not match.')
B
5 attempt = int(input('Student ID: ')) 6 if attempt != student_id: 7 print('Did not match.')
C
5 print('Did not match.') 6 if attempt == student_id: 7 break
D
5 print('Did not match.') 6 attempt = int(input('Student ID: '))
登录即可查看完整答案
我们收录了全球超50000道真实原题与详细解析,现在登录,立即获得答案。
类似问题
How many times will Python run the <body contents> inside the while loop before exiting? x = 1 y = 1 while y < 4: <body contents> y = y + 2
What's the value of total after running this code:
The following code will loop through the code and ultimately print out the numbers 1-11. Select the missing syntax from the TWO dropdown list boxes. i = 1 [ Select ] while as long as If else when i < [ Select ] i+1: 11: i: 0: 12: 1: print(i) i = i + 1
What type of control structure is shown below?
更多留学生实用工具
希望你的学习变得更简单
加入我们,立即解锁 海量真题 与 独家解析,让复习快人一步!