ADITYA CODING CLUB
Aditya College of Engineering, Madanapalle
Python Programming Test-10
1. Test contains 10 Questions 
2. Each Question Carries 1 Mark
Roll Number: *
Type Valid Roll Number 
Name of the Student: *
Department *
Year of Course: *
Required
Section  *
1.  What is the output of  print('%x, %X' % (15, 15)) ? *
1 point
2.  Which of the following is incorrect file handling mode in Python? *
1 point
3.  What is the output of the following print() function? *
1 point
4.  What will be displayed as an output on the screen?

x = float('NaN') print('%f, %e, %F, %E' % (x, x, x, x))
*
1 point
5. What happens if the file is not found in the following Python code?
a=False while not a: try: f_n = input("Enter file name") i_f = open(f_n, 'r') except: print("Input file not found")
*
1 point
6. What will be the output of the following Python code?
lst = [1, 2, 3] lst[3]
*
1 point
7.  What will be the output of the following Python code?
def getMonth(m): if m<1 or m>12: raise ValueError("Invalid") print(m)
getMonth(6)
*
1 point
8.  What will be the output of the following Python code if the input entered is 6?
valid = False while not valid: try: n=int(input("Enter a number")) while n%2==0: print("Bye") valid = True except ValueError: print("Invalid")
*
1 point
9.  Which of the following is not a standard exception in Python?
*
1 point
10.  Which of the following blocks will be executed whether an exception is thrown or not? *
1 point
Submit
Clear form
Never submit passwords through Google Forms.
This content is neither created nor endorsed by Google. Report Abuse - Terms of Service - Privacy Policy