Question 6 - Week 2 Practice | Prasnya
Prasnya
Continue with Google
Practice path
Dashboard
Exam
Qualifier / Quiz 1
Go to subject
Programing with python
Go to chapter
Week 2
Question 6
00:00
Est. 2 min
Marks:
+3.00
0.00
Consider the following code snippet where `num` gets an integer number from user input. ``` num = int(input()) if num > 0: num = num + 100 else: num = abs(num - 100) print(num) ``` Choose the correct options regarding the above code.
Multiple correct
Medium Difficulty
27 October 2024
A
It prints different values based on the magnitude of the input number.
B
It always adds
100
100
and prints the final value.
C
If the input is either `+num` or `-num`, the output is same.
D
An equivalent code segment is: ``` num = float(input()) num = abs(num) + 100 print(num) ```