98 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): Python is a dynamically typed language.Reasoning (R): The data type of a variable is declared as per the type of value...
Question 3Assertion (A): In Python, strings, lists and tuples are called sequences.Reasoning (R): Sequence is referred to as an ordered collection of...
Question 4Assertion (A): Comments are non-executable statements that are ignored by the interpreter.Reasoning (R): Comments are used to explain the...
Question 5Assertion (A): A set of valid characters recognized by Python constitutes a character set.Reasoning (R): Character set in Python is a...
Question 6Assertion (A): 'Rollnumber' and 'rollnumber' are same identifiers.Reasoning (R): Python is a case-sensitive language.Both A and R are true...
Question 7Assertion (A): Literals are same as identifiers.Reasoning (R): A variable is a label for a location in memory.Both A and R are true and R...
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 13A logical error does not stop execution but the program behaves incorrectly and produces undesired/wrong output.
Question 14Trying to access a variable or file that doesn't exist is a kind of Run-time error.
Question 1Which of the following are the fundamental building blocks of a Python program?IdentifiersConstantsPunctuatorsTokens
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 8Which of the following is not in Python character set?Letters: A - Z or a - zDigits: 0 - 9Whitespaces: blank space, tab, etc.Images: Vector
Question 9Each statement in Python is terminated by ............... .Semicolon (;)Colon (:)Comma (,)None of these
Question 10The extension of a Python file is given as-.pt.pwy.py or .pyw.yppy
Question 11The reserved words used by Python interpreter to recognize the structure of a program are termed as ..................
Question 12What can be the maximum possible length of an identifier?316379Can be of any length
Question 13Which of the following operators is floor division?+///>
Question 14Which of the following is an invalid statement?a=b=c=2a,b,c=10,20,30abc = 20 30 40a_b_c=20
Question 15What is the result of this statement:10>5 and 7>12 or not 18>3 10TrueFalseNone
Question 16What will be the output of the following Python code?>>> 6*3+4**2//5-8 1314ErrorNone
Question 17What 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 5Identify invalid variable names from the following, giving reason for each:Group, if, total marks, S.I., volume, tot_strength, #tag,...
Question 6(a)Find the output of the following code:x=3 y=x+2 x+=y print(x,y)
Question 6(b)Find the output of the following code:x=-2 y=2 x+=y y-=x print (x,y)
Question 6(c)Find the output of the following code:a=5 b=2*a a+=a+b b*=a+b print (a,b)
Question 6(d)Find the output of the following code:p=10 q=20 p*=q/3 q+=p+q*2 print (p,q)
Question 6(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 6(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 7Write 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 8Write 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 9What are operators? Give some examples of unary and binary operators.
Question 10What is an expression and a statement?
Question 11What all components can a Python program contain?
Question 12What are variables? How are they important for a program?
Question 13What is 'Dynamic Typing' feature in Python?
Question 14Write 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 15Modify the above function to take a third parameter called shape type. Shape type should be either triangle or rectangle. Based on the...
Question 16Write a function called print_pattern() that takes integer number as argument and prints the following pattern if the input number is 3:*...
Question 17Write a program that takes amount in dollars, converts it into rupees. It then displays the converted amount.Solutionamount =...
Question 18What would the following code do?a = b = 70
Question 19What is the error in the following code?z, p = 6
Question 20(a)Find out the error(s) in the following code fragment:temperature = 90 Print temperature
Question 20(b)Find out the error(s) in the following code fragment:a = 30 b = a + b print (a And b)
Question 20(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 20(d)Find out the error(s) in the following code fragment:x = 24 4 = x
Question 20(e)Find out the error(s) in the following code fragment:Print ("X =" X)
Question 21(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 21(b)What will be the output produced by the following code fragment?first = 2 second = 3 third = first * second print (first, second,...
Question 21(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 22"Comments are useful and an easy way to enhance readability and understandability of a program." Elaborate with examples.
Question 23(a)Find errors in the following code fragment.a = 3 print(a) b = 4 print(b) s = a + b print (s)
Question 23(b)Find errors in the following code fragment.Name = "Prateek" Age = 26 print("your name & age are", Name + Age)
Question 23(c)Find errors in the following code fragment.A = 3 S = A + 10 A = "New" Q = A / 10
Question 24Give the output.x = 40 y = x + 1 x, y = 20, y + x print (x, y)
Question 25Give the output.x, y = 20, 60 y, x, y = x, y - 10, x + 10 print (x, y)
Question 26Give the output.a, b = 12, 13 c, b = a * 2, a/2 print(a, b, c)
Question 27Give the output.a, b, c = 10, 20, 30 p, q, r = c - 5, a + 3, b - 4 print("a and b, :", p, q, r)
Question 28Find errors in the following code fragment. (The input entered as XI)c = int (input ("Enter your class:")) print ("Your class is", c)
Question 29Find errors in the following code fragment.cl = input("Enter your class") print("Last year you were in class", cl - 1)
Question 30Write a Python program that accepts radius of a circle and prints its area.Solutionr = float(input("Enter radius of circle: ")) a =...
Question 31Write a Python program that accepts marks in five subjects and outputs average marks.Solutionm1 = int(input("Enter first subject marks:...
Question 32Write a program to find the area of a triangle.Solutionh = float(input("Enter height of the triangle: ")) b = float(input("Enter base of...
Question 33Write a program to input a number and print its first five multiples.Solutionn = int(input("Enter number: ")) print("First five multiples...
Question 34Write 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 35Write 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 1Python supports Unicode coding standard.
Question 2An identifier must be a keyword of Python.
Question 3Default variable initialization is string literal.
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.
Question 12id() function is used to determine the data type of a variable.