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
19 hours 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
2 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
4 days ago
I agree with Reena, the value of x is 7 so it should print 7.
upvoted 0 times
...
Weldon
10 days ago
Easy peasy, the answer is B) 7. Any non-zero value is considered 'true' in Python.
upvoted 0 times
...
Reena
13 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
15 days ago
B) 7
upvoted 0 times
...

Save Cancel