<jupyter_start><jupyter_text><jupyter_code>print('Welcome to Techno Quiz: ')


ans = input('''Ready to begin (yes/no): ''')
score=0
total_Q=15



if ans.lower() =='yes' :
    
    ans = input(''' 1.How to check your current python version ?
                    A. python version
                    B. python -V
                    Ans:''')
                
 
    if ans.lower () == 'b' :
        score+= 1
        print('correct')
    else:
        print('Incorrect')

    ans = input( '''2.What is used to define a block of code in python ?
                    A.Parenthesis
                    B.Curly braces
                    C.Indentation
                    Ans:''')
            
    if ans.lower () == 'c':
        score+= 1
        print('correct')
    else:
        print('Incorrect')
        print('''Ans : C
        Explanation: Python uses indentation to define block of code.
        Indentations are simply Blank spaces or Tabs which is used as an indicator that indented code is the child part.
       As curlybraces are used in C/C++/Java.. So, Option B is correct.''')


    ans = input( '''3.All keyword in python are in
                    A. Lowercase
                    B. Uppercase
                    C. Both uppercase & Lowercase
                    Ans:''')
            
    if ans.lower () == 'c' :
        score+= 1
        print('correct')
    else:
        print('Incorrect')
        print('''Ans : C
   Explanation: All keywords in python are in lowercase except True, False and None.
   So, Option C is correct.''')


    ans = input( '''4. Dictionary keys must be immutable 
                    {true/false}
                    Ans:''')
            
    if ans.lower () == 'true' :
        score+= 1
        print('correct')
    else:
        print('Incorrect')
        print(''' Explanation: Dictionary keys must  be immutable.which means you can use strings,numbers or tuples
        as dictionary keys and you can't use any mutable object as the key such as list.''')


    ans = input('''5.Which of the following function convert a string to a float in python?
                   A. int(x [,base])
                   B. float(x)
                   C. str(x)
                   Ans:''')       
             
    if ans.lower () == 'b':
        score+= 1
        print('correct')
    else:
        print('Incorrect')
        print('Explanation: float(x) − Converts x to a floating-point number')

        
    ans = input( '''6. In Python, how are arguments passed?
                    A. pass by value
                    B. pass by reference
                    C. It gives options to user to choose
                    Ans:''')
            
    if ans.lower () =='b' :
        score+= 1
        print('correct')
    else:
        print('Incorrect')
        print('''Ans : B
  Explanation: All parameters (arguments) in the Python language are passed by reference.
  It means if you change what a parameter refers to within a function, the change also reflects back in the calling function''')

    ans = input('''7.Which function can be used on the file to display a dialog for saving a file ?
                   A. Filename = savefilename()
                   B. Filename = asksaveasfilename()
                   C. No such option in python
                   Ans:''')
            
    if ans.lower () == 'b' :
        score+= 1
        print('correct')
    else:
        print('Incorrect')

    ans = input( ''' 8.What command is used to shuffle a list 'L' ?
                     A. L.shuffle()
                     B. shuffle(L)
                     C. random.Shuffle(L)
                   Ans:''')
            
    if ans.lower () =='c' :
        score+= 1
        print('correct')
    else:
        print('Incorrect')
        print('''Ans : C
        Explanation:  To shuffle the list we use random.shuffle(List-name)function''')

    ans = input( '''9.What is it called when a function is defined inside a class?
                    A. method
                    B. class
                    C. module
                  Ans:''')

              
            
    if ans.lower () == 'a' :
        score+= 1
        print('correct')
    else:
        print('Incorrect')
        print('''Ans : A
        Explanation: method is called when a function is defined inside a class. So, option C is correct.''')



    ans = input( '''10.Syntax error in python is detected by ______ at _____
                     A. compiler/compile time
                     B. interpreter/run time
                     C. compiler/run time
                   Ans:''')
            
    if ans.lower () == 'b':
        score+= 1
        print('correct')
    else:
        print('Incorrect')
        print('''Ans : B
        Explanation: Syntax error in python is detected by interpreter at run time.''')
        
   
    ans = input( '''11.Which among the following are mutable objects in Python
                    (i) List
                   (ii) Integer
                  (iii) String 
                   (iv) Tuple

               A. i only
               B. i and ii only
               C. iii and iv only
               D. iv only
               Ans:''')
            
    if ans.lower () == 'a' :
        score+= 1
        print('correct')
    else:
        print('Incorrect')    
        print('''Ans : A
        Explanation: List are mutable objects in Python.''')


    ans = input( '''12. In python what is method inside class ?
                     A.attribute
                     B.object
                     C.function
                   Ans:''')
            
    if ans.lower () =='c' :
        score+= 1
        print('correct')
    else:
        print('Incorrect')
        print('''Ans : C
        Explanation: In OOP of Python, function is known by "method".''')


    ans = input( '''13.The elements of a list are arranged in descending order. Which of the following two will give same outputs?
                     i. print(list_name.sort())
                    ii. print(max(list_name))
                   iii. print(list_name.reverse())

            A. i, ii
            B. i, iii
            C. ii, iii
          Ans:''')
            
    if ans.lower () == 'b' :
        score+= 1
        print('correct')
    else:
        print('Incorrect')
        print('''Ans : B
        Explanation: print(list_name.sort()) and print(list_name.reverse()) will give same outputs''')


    ans = input( '''14.Which of the following is correct?
                      {class A:
                           def __init__(self,name):
                             self.name=name
                       a1=A("john")
                       a2=A("john") }

                  A. id(a1) and id(a2) will have same value.
                  B. id(a1) and id(a2) will have different values.
                  C. Two objects with same value of attribute cannot be created
                Ans:''')
            
    if ans.lower () =='b' :
        score+= 1
        print('correct')
    else:
        print('Incorrect')
        print('''Ans : B
       Explanation: Although both a1 and a2 have same value of attributes,
      but these two point to two different object.
      Hence, their id will be different.''')

    ans = input( '''15.Python was developed by
                <NAME>
                B. <NAME>
                C. <NAME>
                 Ans:''')
            
    if ans.lower () == 'a' :
        score+= 1
        print('correct')
    else:
        print('Incorrect')
        print('''Ans : A
        Explanation: A Dutch Programmer <NAME> developed python
        at Centrum Wiskunde & Informatica (CWI) in the Netherlands as a successor to the ABC language.


''')
   
print('Result :', score, "questions correct.")
marks = (score/total_Q) * 100

print ("Marks Accqired [%] : ",marks)


print('''Thankyou for taking part in Techno Quiz 
            Have a Nice Day!!! ''')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10775047258979206, 'fraction_numerical': 0.00630119722747322, 'mean_word_length': 1.352801660243107, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '667487', 'license': 'Apache-2.0', 'n_tokens_mistral': 2241, 'n_tokens_neox': 2079, 'n_words': 760, 'path': 'Quiz.ipynb', 'repo_name': 'sandeepkumarpradhan71/sandeepkumar', 'size': '7973'}