Informatics Practices
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)
Getting Started
2 Likes
Answer
(a) It raises TypeError as 'n' is an invalid keyword argument for print()
function.
(b) 17
(c) 4.2 hello 4 world 7.5
Answered By
2 Likes
Related Questions
Use IDLE to calculate:
(a) 6+4*10
(b) (6+4) *10
Write a code that prints your full name and your birthday as separate strings.
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.Try the following code on the Python shell and evaluate the output generated:
>>> print (3.14159*7) >>> print('I am a class XI' + 'student') >>> print('I', 'am') >>> print ("class XI student") >>> print ("I'm", 16, "years old")