Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

GIAC Exam GPYC Topic 2 Question 42 Discussion

Actual exam question for GIAC's GPYC exam
Question #: 42
Topic #: 2
[All GPYC Questions]

What will be printed below if the value of x is 7?

>>> if(x):

... print(x)

...

Show Suggested Answer Hide Answer
Suggested Answer: C, D

Contribute your Thoughts:

Heike
9 days ago
Wait, is this a trick question? I'm going with D) 0 just to be safe. You can never be too careful with these certification exams.
upvoted 0 times
...
Chau
11 days ago
Hmm, I was thinking C) true, but I guess B) 7 makes more sense since the variable is directly printed.
upvoted 0 times
...
Lizbeth
13 days ago
I agree with Reena, the value of x is 7 so it should print 7.
upvoted 0 times
...
Weldon
19 days ago
Easy peasy, the answer is B) 7. Any non-zero value is considered 'true' in Python.
upvoted 0 times
...
Reena
22 days ago
I think it will print 7 because the condition 'if(x)' will evaluate to true since x is 7.
upvoted 0 times
...
Roxane
23 days ago
B) 7
upvoted 0 times
...

Save Cancel
az-700  pass4success  az-104  200-301  200-201  cissp  350-401  350-201  350-501  350-601  350-801  350-901  az-720  az-305  pl-300  

Warning: Cannot modify header information - headers already sent by (output started at /pass.php:70) in /pass.php on line 77