English

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

Advertisements
Advertisements

Question

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

num1 = int('3.14')
print (num1)

Short/Brief Note
Advertisements

Solution

num1 = int('3.14')

This will result in an error as we cannot pass the string representation of float to an int function.

shaalaa.com
  Is there an error in this question or solution?
Chapter 5: Getting Started with Python - Exercise [Page 117]

APPEARS IN

NCERT Computer Science [English] Class 11
Chapter 5 Getting Started with Python
Exercise | Q 7. i) | Page 117
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×