Skip to content
free
K
1
2
practice
Home
Math
English
Science
Social Studies
Contact
Language
English
Español
Sign In
/
High School Electives
/
Computer Science
/
Input and Output
Grade Level
Computer Science
HSCS.112 Input and Output
0%
Skill Level
🔴 Hard
00:00
Progress to Next Level
25% to Medium
Easy
Medium
Hard
Mastery
100%
A badge scanner must read a code. If it starts with VIP-, display Access: priority; otherwise display Access: standard. Which fragment is correct? `[NL]` marks a new line; `[I1]` and `[I2]` mark one and two indentation levels.
A
code = input("Badge code: ") [NL] if code.startswith("VIP-"): [NL] [I1] print("Access: access") [NL] else: [NL] [I1] print("Access: access")
B
code = input("Badge code: ") [NL] if code.startswith("VIP-"): [NL] [I1] access = "priority" [NL] else: [NL] [I1] access = "standard" [NL] print("Access: " + access)
C
code = int(input("Badge code: ")) [NL] if code.startswith("VIP-"): [NL] [I1] access = "priority" [NL] else: [NL] [I1] access = "standard" [NL] print("Access: " + access)
D
code = input("Badge code: ") [NL] if code.endswith("VIP-"): [NL] [I1] access = "priority" [NL] else: [NL] [I1] access = "standard" [NL] print("Access: " + access)
Submit Answer