Robotics & Artificial Intelligence
Assertion (A): Python works in two different modes. These modes are used as per the need of the user while performing the tasks.
Reason (R): Interactive mode refers to the mode where the user is able to see the instant output for the given input. Whereas, the script mode is used only when the user needs to make a program file.
Based on the above discussion, choose an appropriate statement from the options given below:
- Both A and R are true and R is the correct explanation of A.
- Both A and R are true and R is not the correct explanation of A.
- A is true but R is false.
- A is false but R is true.
- Both A and R are false.
Getting Started
1 Like
Answer
Both A and R are true and R is the correct explanation of A.
Reason — Python works in two different modes namely Interactive mode and Script mode. The interactive mode allows the user to obtain instant output by typing a command at the Python prompt (>>>) and pressing 'Enter'. The script mode allows the user to write and save a complete set of instructions as a program file. Hence, the reason correctly explains the assertion.
Answered By
2 Likes
Related Questions
Evaluate the following expressions:
Given: a=5; b=4
- 12*(a+b)-10
- 12*a+b-10
- 12+a*b-10
- 12-10+a*b
Write down the escape sequences for the following:
Description Escape Sequences Horizontal tab Backslash Single quote Double quote Backspace New line feed In Python programming, this mode refers to the mode where the user can instantly obtain the output, for the input given. The moment a statement or a command is typed in the Python command prompt and the 'Enter' key is pressed, the output will appear on the next line of the interactive screen.
Read the above paragraph to answer the following questions:
(a) Name the mode where get the instant output on the screen.
(b) Write down representation of the default Python prompt.
Write short notes on Character Sets with reference to Python language.