मराठी

Give the output of the following when num1 = 4, num2 = 3, num3 = 2. num1 = '5' + '5' print(num1) - Computer Science (Python)

Advertisements
Advertisements

प्रश्न

Give the output of the following when num1 = 4, num2 = 3, num3 = 2.

num1 = '5' + '5'
print(num1)

टीपा लिहा

उत्तर

num1 = '5' + '5'

The RHS in the above statement is '5' + '5'. Please note that 5 is enclosed in quotes and hence will be treated as a string. Therefore, the first line is just a string concatenation which will give the output 55. The type of output will be a string, not an integer.

shaalaa.com
Python Data Types
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 5: Getting Started with Python - Exercise [पृष्ठ ११६]

APPEARS IN

एनसीईआरटी Computer Science [English] Class 11
पाठ 5 Getting Started with Python
Exercise | Q 7. d) | पृष्ठ ११६
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×