Computer Science
Find the errors in following code fragment:
y = x + 5
print (x, Y)
Python Funda
42 Likes
Answer
There are two errors in this code fragment:
- x is undefined in the statement
y = x + 5
- Y is undefined in the statement
print (x, Y)
. As Python is case-sensitive hence y and Y will be treated as two different variables.
Answered By
22 Likes
Related Questions
Predict the output:
a, b = 12, 13 print (print(a + b))
Predict the output
a, b, c = 10, 20, 30 p, q, r = c - 5, a + 3, b - 4 print ('a, b, c :', a, b, c, end = '') print ('p, q, r :', p, q, r)
Find the errors in following code fragment:
print (x = y = 5)
Find the errors in following code fragment:
a = input("value") b = a/2 print (a, b)