GPYC Exam Questions
71 real GPYC exam questions with expert-verified answers and explanations. Page 2 of 2.
- Question #51
Examine the code snippet below. What will be the contents of the variable i during the loops first iteration? ``` phrase = "Python is a powerful language".split() for i in phrase:...
- Question #52
A .gif file has the following attributes: Extension: .gif Magic value for start of file: \x47\x49\x46\x38 Magic value for end of file: \x3b A small data file called "raw_data" cont...
- Question #53
What will be printed when the code in the screen capture is run? ```python >>> x=1 >>> y=2 >>> if x() and (y): ... z=x+y ... print(z) ... elif x() or (y): ... z=y-x ... print(z) .....
- Question #54
What does the LIMIT function restrict in an SQL SELECT statement?
- Question #55
Variable "traffic" contains a Scapy packet list. A programmer runs the following command: `p1=traffic[1]` Which of the following describes the contents of p1, with respect to the "...
- Question #56
Which of the following is the output when the following program is executed with a Python Interpreter? ```python >>> a = -10 >>> if a: ... print(a) ... else: ... print(-a) ```
- Question #57
During a password guessing attack, which HTTP request method would a Python program most commonly call to submit a username and password to a target website?
- Question #58
What will the following code in Python 3 result in? ```python >>> x = 'global x' >>> def outer_func(): ... x = 'outer x' ... def inner_func(): ... print(x) ... inner_func() ... pri...
- Question #59
What does the following line of code do? `s.sendto(data, ('127.0.0.1', 5000))`
- Question #60
What is the output of the following line of code typed into a Python interactive session? `>>>print(8 << 1)`
- Question #61
What does the attacker do in a SQL Injection attack?
- Question #62
With a requests session object named "browser", how can the expiration attribute of a cookie named "MUID" from "gpyc.com/" be accessed?
- Question #63
What does the following command do? pip search syslog
- Question #64
Which of the lambda definitions of the function some_code is equivalent to the following function definition? def some_code (invalue): outvalue = invalue * 2 return outvalue
- Question #65
Which of the following modules allows a programmer to specify and spawn new processes, connect to their input and output pipes, and retrieve returned data?
- Question #66
What will the last value of V be when Python executes the following control loop? for x in range(4, 20, 2): print(x)
- Question #67
In a SQL injection attack, which character would an attacker use to separate multiple SQL statements on a single line?
- Question #68
An attacker does not yet know the IP address of his target. He uses the "socket" module to create a backdoor program. He is writing the command to bind the computer's current IP ad...
- Question #69
What will be the value of the i variable when the while loop finishes its execution? i = 0 while i != 0: i = i + 1 else: i = i + 1
- Question #70
An operator able to perform bitwise shifts is coded as (select two answers)
- Question #71
When the following program "question.py" is executed with Python what is the output? $ cat question.py def i(i): i=i return i i=i(10) print(i) $ python question.py