Informatics Practices
Consider the statements given below and write Python command to display these statements in both Interactive and Script mode.
Python is easy to learn and write.
It allows us to work in two modes: Interactive mode and Script mode.
Interactive mode is also known as Python Shell and Script mode is also known as Python Editor.
It is a platform-independent language.
We find it interesting to work with Python.
Answer
Interactive Mode:
>>> print("Python is easy to learn and write.")
>>> print("It allows us to work in two modes: Interactive mode and Script mode.")
>>> print("Interactive mode is also known as Python Shell and Script mode is also known as Python Editor.")
>>> print("It is a platform-independent language.")
>>> print("We find it interesting to work with Python.")
Script Mode:
print("Python is easy to learn and write.")
print("It allows us to work in two modes: Interactive mode and Script mode.")
print("Interactive mode is also known as Python Shell and Script mode is also known as Python Editor.")
print("It is a platform-independent language.")
print("We find it interesting to work with Python.")
Related Questions
Record what happens when the following statements are executed:
(a) print (n = 17)
(b) print (8+9)
(c) print (4.2, "hello", 6-2, "world", 15/2.0)
Write Python statement for the following in interactive mode:
- To display sum of 3, 8.0, 6*12
- To print sum of 16, 5.0, 44.0
Write a code that prints your full name and your birthday as separate strings.
Write the output of the following:
num1 = 4 num2 = num1 + 1 num1 = 2 print(num1, num2)