Tag: Question

  • Python Quizs Question– String II

    Q 1. What will be the output of the following Python code snippet? print(‘Ab!2’.swapcase()) A. AB!@B. ab12C. aB1@ D. aB!2 Show Answer Answer:-D. aB!2 Explanation Lowercase letters are converted to uppercase and vice-versa. Q 2. What will be the output of the following Python code snippet? print(‘ab cd ef’.title()) A. Ab cd efB. Ab cd…

  • Python Multiple Choice Quizs Question– String

    Q 1. The output of executing string.ascii_letters can also be achieved by:A. string.ascii_lowercase_string.digitsB. string.lowercase_string.uppercaseC. string.lettersD. string.ascii_lowercase+string.ascii_uppercase Show Answer Answer:-D. string.ascii_lowercase+string.ascii_uppercase Explanation Execute in shell and check. Q 2 . What will be the output of the following Python code? A. ollehB. helloC. hD. o Show Answer Answer:-D. o Explanation 1 corresponds to the last index.…

  • Python Quizs Question and Answers – While and For Loops – 2

    Q 1. What will be the output of the following Python code? x = “abcdef” while i in x: print(i, end=” “) A. a b c d e fB. abcdefC. i i i i i i …D. error Show Answer Answer:-D. error Explanation NameError, i is not defined. Q 2. What will be the output…

  • Python Multiple Choice Quizs Question – While and For Loops 1

    Q 1. What will be the output of the following Python code? i = 1 while True: if i%3 == 0: break print(i)   i + = 1 A. 1 2B. 1 2 3C. errorD. none of the mentioned Show Answer Answer:-C. error Explanation SyntaxError, there shouldn’t be a space between + and = in…

  • Python Quizs Question and Answers – Formatting – 2

    Q 1. The output of which of the codes shown below will be: “There are 4 blue birds.”?A. ‘There are %g %d birds.’ %4 %blueB. ‘There are %d %s birds.’ %(4, blue)C. ‘There are %s %d birds.’ %[4, blue]D. ‘There are %d %s birds.’ 4, blue Show Answer Answer:-B. ‘There are %d %s birds.’ %(4,…

  • Python Quizs Question and Answers – Formatting – 1

    Q 1. What will be the output of the following Python expression if x=456? print(“%-06d”%x) A. 000456B. 456000C. 456D. error Show Answer Answer:-C. 456 Explanation The expression shown above results in the output 456. Q 2. What will be the output of the following Python expression if S=345? print(“%06d”%S) A. 345000B. 000345C. 000000345D. 345000000 Show…

  • Python Quizs Question and Answers – Decorators

    Q 1. In the following Python code, which function is the decorator? def mk(x): def mk1(): print(“Decorated”) x() return mk1 def mk2(): print(“Ordinary”) p = mk(mk2) p() A. p()B. mk()C. mk1()D. mk2() Show Answer Answer:-B. mk() Explanation In the code shown above, the function mk() is the decorator. The function which is getting decorated is…

  • Python Quizs Question and Answers – Bitwise – 2

    Q 1. It is not possible for the two’s complement value to be equal to the original value in any case.A. TrueB. False Show Answer Answer:-B. False Explanation In most cases the value of two’s complement is different from the original value. However, there are cases in which the two’s complement value may be equal…

  • CSS Quizs Question & Answers – Cross-Browser Layout Techniques

    Q 1. Which of the following property defines how content should behave when it exceeds the width of its enclosing element?A. overflow-yB. overflow-xC. overflow-zD. overflow-width Show Answer Answer:-B. overflow-x Explanation Syntax: overflow-x: auto | hidden Q 2. Which of the following property is used to give a 3-D sense of depth to an element?A. animationB.…

  • CSS Quizs Question & Answers – Border Elements

    Q1. Which of the following property defines the style for the right border of an element?A. border-spacingB. border-spacingC. border-rightD. border-right-style Show Answer Answer:-C. border-right Explanation Syntax: border-right-style: dashed | dotted | double Q 2. Which of the following property defines the color of an element’s top border?A. border-colorB. border-topC. border-top-color-webkitD. border-top-color Show Answer Answer:-D. border-top-color…

You cannot copy content of this page