102 solutions available
Question 1Assertion (A): Each component of a programming statement is known as a token.Reasoning (R): Token is not executed by Python interpreter,...
Question 2Assertion (A): The data type of a variable is declared as per the type of value assigned to it.Reasoning (R): Python exhibits the feature...
Question 3Assertion (A): In Python, integers are zero, positive or negative whole numbers without a fractional part.Reasoning (R): -45, 655.55,...
Question 4Assertion (A): In Python, strings, lists and tuples are called sequences.Reasoning (R): Sequence is referred to as an ordered collection of...
Question 5Assertion (A): Comments are non-executable statements that enable the users to understand the program logic.Reasoning (R): Comments are...
Question 6Assertion (A): A set of valid characters recognized by Python constitutes a character set.Reasoning (R): Character set in Python is a...
Question 7Assertion (A): 'Rollnumber' and 'rollnumber' are same identifiers.Reasoning (R): Python is a case-sensitive language, i.e., it treats...
Question 8Assertion (A): Floor division operator (//) in Python is different from division operator.Reasoning (R): Consider the given two...
Question 1The smallest individual unit in a program is known as a Token.
Question 2A word having special meaning reserved by a programming language is known as Keyword.
Question 3A String literal is a sequence of characters surrounded by quotes.
Question 4Operators are tokens that trigger same computation/action when applied to variables or operands.
Question 5A Variable is a reserved named location that stores values.
Question 6To determine the type of an object, we use type() function.
Question 7The input() function always returns a value of String type.
Question 8Blocks of codes are represented through indentation.
Question 9In dynamic typing, a variable can hold values of different types at different times.
Question 10In Python, the floating-point numbers have precision of 16 digits.
Question 11Operators that act upon two operands are referred to as binary operators.
Question 12Floor division truncates fractional remainders and gives only the whole part as the result.
Question 13The process of identifying and removing errors from a computer program is called debugging.
Question 14A logical error does not stop execution but the program behaves incorrectly and produces undesired/wrong output.
Question 15Trying to access a variable or file that doesn't exist is a kind of Run-time error.
Question 1Which of the following are not the fundamental building blocks of a Python program?IdentifiersConstantsKeywordsErrors
Question 2Identifier name cannot be composed of special characters other than ............... .#Hyphen (-)$\text{\textdollar}$Underscore (_)
Question 3Python takes ............... indented spaces after the function declaration statement by default.5643
Question 4Single line comments in Python begin with ............... symbol.#"'''%
Question 5Which of the following does not represent a complex number?K = 2 + 3jK = complex(2,3)K = 2 + 3iK = 4 + 3j
Question 6What is the order of precedence of arithmetic operators given below in Python?(1) Parenthesis(2) Exponential(3) Multiplication(4)...
Question 7What will be the output of the following snippet?x, y = 2, 6 x, y = y, x + 2 print(x, y) 6 64 44 66 4
Question 8The extension of a Python file is given as-.pt.pwy.py or .pyw.yppy
Question 9The reserved words used by Python interpreter to recognize the structure of a program are termed as ..................
Question 10Which of the following is a syntactically correct string?"This is great !"'she shouted 'HELLO' loudly'"Goodbye'"This "course" is good"
Question 11What can be the maximum possible length of an identifier?316379Can be of any length
Question 12Which of the following operators is floor division?+///>
Question 13Which of the following is an invalid statement?a=b=c=20a,b,c=10,20,30abc = 20 30 40a_b_c=20
Question 14What is the result of this statement:10>5 and 7>12 or not 18>3 10TrueFalseNone
Question 15What will be the output of the following Python code?>>> 6*3+4**2//5-8 1314ErrorNone
Question 16What will be the output of the following Python code?>>> a=72.55 >>> b=10 >>> c=int(a + b) >>> c...
Question 1Write a Python command/instruction/statement to display your name.
Question 2Write a Python command to display your school name, class and section, separated by "-".
Question 3Evaluate the following expressions manually:(a) (2 + 3) ** 3 - 6/2(b) (2 + 3) * 5//4 + (4 + 6)/2(c) 12 + (3 * 4 - 6)/3(d) 12 + (3 ** 4 -...
Question 4Evaluate the above expressions by using IDLE as a calculator and verify the results that you get manually.
Question 5Name three runtime errors that occur during Python program execution.
Question 6What is the difference between an error and exception?
Question 7Explain the difference between syntax error and runtime error with examples.
Question 8Identify invalid variable names from the following, giving reason for each:Group, if, total marks, S.I., volume, tot_strength, #tag,...
Question 9(a)Find the output of the following code:x=3 y=x+2 x+=y print(x,y)
Question 9(b)Find the output of the following code:x=-2 y=2 x+=y y-=x print (x,y)
Question 9(c)Find the output of the following code:a=5 b=2*a a+=a+b b*=a+b print (a,b)
Question 9(d)Find the output of the following code:p=10 q=20 p*=q/3 q+=p+q*2 print (p,q)
Question 9(e)Find the output of the following code:p = 5 % 2 q = p ** 4 r = p // q p+= p + q + r r+= p + q + r q-= p + q * r print(p, q, r)
Question 9(f)Find the output of the following code:p = 21 // 5 q = p % 4 r = p * q p+= p + q - r r*= p - q + r q+= p + q print(p, q, r)
Question 10Write Python expressions equivalent to the following arithmetic/algebraic expressions:(a) a+b2\dfrac{a + b}{2}2a+b(b) 32+932\dfrac{3^2 +...
Question 11Write Python expressions to represent the following situations:(a) Add remainder of 8/3 to the product of 8 and 3.(b) Find the square root...
Question 12What are operators? What is their function? Give examples of some unary and binary operators.
Question 13What is an expression and a statement?
Question 14What all components can a Python program contain?
Question 15What are variables? How are they important for a program?
Question 16What is 'Dynamic Typing' feature in Python?
Question 17Which data type will be used to represent the following data values and why?(a) Number of months in a year(b) Resident of Delhi or not(c)...
Question 18Write a function called calculate_area() that takes base and height as an input argument and returns an area of a triangle as an output....
Question 19Modify the above function to take a third parameter called shape type. Shape type should be either triangle or rectangle. Based on the...
Question 20Write a function that takes amount in dollars and performs dollar-to-rupee price conversion; it then displays the amount converted to...
Question 21What would the following code do?a = b = 70
Question 22What is the error in the following code?z, p = 6
Question 23(a)Find out the error(s) in the following code fragment:temperature = 90 Print temperature
Question 23(b)Find out the error(s) in the following code fragment:a = 30 b = a + b print (a And b)
Question 23(c)Find out the error(s) in the following code fragment:a, b, c = 2, 8, 9 print(a, b, c) c, b, a + a, b, c print(a; b; c)
Question 23(d)Find out the error(s) in the following code fragment:x = 24 4 = x
Question 23(e)Find out the error(s) in the following code fragment:Print ("X =" X)
Question 24(a)What will be the output produced by the following code fragment?X = 10 X = X+10 X = X-5 print (X) X, Y = X - 2, 22 print (X, Y)
Question 24(b)What will be the output produced by the following code fragment?first = 2 second = 3 third = first * second print (first, second,...
Question 24(c)What will be the output produced by the following code fragment?side = int (input ('side')) #Side given as 7 area = side * side print...
Question 25"Comments are useful and an easy way to enhance readability and understandability of a program." Elaborate with examples.
Question 26(a)Find errors in the following code fragment.a = 3 print(a) b = 4 print(b) s = a + b print (s)
Question 26(b)Find errors in the following code fragment.Name = "Prateek" Age = 26 print("your name & age are", Name + Age)
Question 26(c)Find errors in the following code fragment.A = 3 S = A + 10 A = "New" Q = A / 10
Question 27Give the output.x = 40 y = x + 1 x, y = 20, y + x print (x, y)
Question 28Give the output.x, y = 20, 60 y, x, y = x, y - 10, x + 10 print (x, y)
Question 29Give the output.a, b = 12, 13 c, b = a * 2, a/2 print(a, b, c)
Question 30Give the output.a, b, c = 10, 20, 30 p, q, r = c - 5, a + 3, b - 4 print(p, q, r)
Question 31Find errors in the following code fragment. (The input entered as XI)c = int (input ("Enter your class:")) print ("Your class is", c)
Question 32Find errors in the following code fragment.cl = input("Enter your class") print("Last year you were in class", cl - 1)
Question 33Write a Python program that accepts radius of a circle and prints its area.Solutionr = float(input("Enter radius of circle: ")) a =...
Question 34Write Python program that accepts marks in 5 subjects and outputs total and average marks.Solutionsubject1 = float(input("Enter marks for...
Question 35Write a program to find the area of a triangle.Solutionh = float(input("Enter height of the triangle: ")) b = float(input("Enter base of...
Question 36Write a program to input a number and print its first five multiples.Solutionn = int(input("Enter number: ")) print("First five multiples...
Question 37Write a program to read details like name, class, age of a student and then print the details, firstly in the same line and then in...
Question 38Write a program to read three numbers in three variables and swap first two variables with the sums of first and second, second and third...
Question 39Write Python codes for the following statements:(a) Assign value 10 to variable a.(b) Assign value 10 to variables a, b and c.(c) Assign...
Question 1Python supports Unicode coding standard.
Question 2An identifier must be a keyword of Python.
Question 3Integers and strings are immutable data types.
Question 43+C = A is a valid statement.
Question 5The input() method always returns a value of an integer type.
Question 6The print() method without any value or name or expression prints a blank line.
Question 7In Python, boolean type is a sub-type of integer.
Question 8"AISSCE-2020" is a valid string variable in Python.
Question 9In Python, integer data type has a fractional part.
Question 10Null literal in Python means "there's nothing here".
Question 11Python supports multiple assignments to multiple variables.