Python IITU 2017

Beschreibung

Final questions
YouTube Channel
Quiz von YouTube Channel, aktualisiert more than 1 year ago
YouTube Channel
Erstellt von YouTube Channel vor mehr als 6 Jahre
101
0

Zusammenfassung der Ressource

Frage 1

Frage
1. What is the output of print str if str = 'Hello World!'?
Antworten
  • Hello World
  • Hello World!
  • World
  • ‘Hello World!’

Frage 2

Frage
What is the output of print str * 2 if str = 'Hello World!'?
Antworten
  • Hello World
  • Hello World! Hello World!
  • World
  • ‘Hello World! Hello World

Frage 3

Frage
Which of the following is correct about dictionaries in python?
Antworten
  • Python's dictionaries are kind of hash table type
  • They work like associative arrays or hashes found in Perl and consist of key-value pairs
  • A dictionary key can be almost any Python type, but are usually numbers or strings. Values, on the other hand, can be any arbitrary Python object
  • All of the above

Frage 4

Frage
What is the output of print tinylist * 2 if tinylist = [123, 'john']?
Antworten
  • [123, ‘john’, 123, ‘john’]
  • [123, 'john'] * 2
  • Error
  • [123, 'john']

Frage 5

Frage
What is the output of print str[2:] if str = 'Hello World!'?
Antworten
  • llo World!
  • H
  • llo
  • Hello World!

Frage 6

Frage
What is the output of len([1, 2, 3])?
Antworten
  • 1
  • 2
  • 3
  • 4

Frage 7

Frage
What is the output of print str * 2 if str = 'Hello World!'?
Antworten
  • Hello World!Hello World!
  • Hello World! * 2
  • error
  • 2

Frage 8

Frage
Which of the following function convert an integer to a character in python?
Antworten
  • set(x)
  • dict(d)
  • frozenset(s)
  • chr(x)

Frage 9

Frage
Which of the following function checks in a string that all characters are in lowercase?
Antworten
  • islower()
  • isnumeric()
  • isspace()
  • istitle()

Frage 10

Frage
Which of the following function returns the max alphabetical character from the string str?
Antworten
  • lower()
  • lstrip()
  • max(str)
  • min(str)

Frage 11

Frage
Which of the following is correct about Python?
Antworten
  • It supports functional and structured programming methods as well as OOP.
  • It can be used as a scripting language or can be compiled to byte-code for building large applications.
  • It provides very high-level dynamic data types and supports dynamic type checking.
  • All of the above

Frage 12

Frage
What is the output of L[1:] if L = [1,2,3]?
Antworten
  • 2,3
  • 2
  • 3
  • None of the above.

Frage 13

Frage
What is the output of L[-2] if L = [1,2,3]?
Antworten
  • 1
  • 2
  • 3
  • -2

Frage 14

Frage
What is the following function sorts a list?
Antworten
  • list.reverse()
  • list.sort()
  • list.pop(obj=list[-1])
  • list.remove(obj)

Frage 15

Frage
State the output that would be produced from the following statement, when written in Python code: print “3”+”3”
Antworten
  • 33
  • 3
  • 6
  • 333

Frage 16

Frage
State the output that would be produced from the following statement, when written in Python code: print 3+3
Antworten
  • 33
  • 3
  • 6
  • 333

Frage 17

Frage
State the output that would be produced from the following statement, when written in Python code: print “3” * 3
Antworten
  • 33
  • 3+3
  • 6
  • 333

Frage 18

Frage
What is the output of print str[2:5] if str = 'Hello World!'?
Antworten
  • llo World!
  • H
  • llo
  • None of the above.

Frage 19

Frage
Which of the following function converts a string to all uppercase?
Antworten
  • upper()
  • isdecimal()
  • swapcase()
  • title()

Frage 20

Frage
Which of the following function converts a string to all lowercase?
Antworten
  • upper()
  • isdecimal()
  • lower()
  • title()

Frage 21

Frage
Functions must be defined first ____________ they can be called
Antworten
  • Before
  • After
  • Between
  • At the same time

Frage 22

Frage
What is the output of for x in [1, 2, 3]: print x?
Antworten
  • X x x
  • 1 2 3
  • Error
  • 1,2,3

Frage 23

Frage
What is the output when following statement is executed print “a”+ “bc” ?
Antworten
  • A
  • a
  • abc
  • bc

Frage 24

Frage
What is the output when we execute print (list("hello"))?
Antworten
  • [‘h’, ’e’, ’l’, ‘l’, ‘o’]
  • [‘hello’]
  • [‘llo’]
  • {‘hello’}

Frage 25

Frage
What is the output from the following code str1="helloworld", str1[::-1]?
Antworten
  • dlrowolleh
  • hello
  • world
  • helloworld

Frage 26

Frage
Suppose list1 is [2, 33, 222, 14, 25], What is list1[:-1]?
Antworten
  • [2, 33, 222, 14]
  • Error
  • 25
  • [25, 14, 222, 33, 2]

Frage 27

Frage
Which of the following is a Python tuple?
Antworten
  • [1, 2, 3]
  • (1, 2 ,3)
  • {1, 2, 3}
  • {}

Frage 28

Frage
Is Python case sensitive when dealing with identifiers?
Antworten
  • Yes
  • No

Frage 29

Frage
Which of the following cannot be a variable?
Antworten
  • __init__
  • in
  • it
  • on

Frage 30

Frage
Supports ‘Last in, first out’ ordering of data
Antworten
  • Queue
  • Stack
  • Tuple
  • Dictionary

Frage 31

Frage
Which of the following is correct output of “print type(1/2)”?
Antworten
  • <type 'int'>.
  • <type 'number'>
  • <type 'float'>
  • <type 'double'>
  • <type 'tuple'>

Frage 32

Frage
Which of the following is correct output of “print type([1,2])”?
Antworten
  • <type 'list'>
  • <type 'number'>
  • <type 'float'>
  • <type 'double'>
  • <type 'tuple'>

Frage 33

Frage
Which of the following is correct output of “import math print(math.floor(5.6))”?
Antworten
  • 6
  • 5.5
  • 5.0
  • 5

Frage 34

Frage
Which of the following is correct output of “colors = [‘Red’, ‘Black’, ‘White’, ‘Green’] x = colors.index(“White”) print(x)”?
Antworten
  • 2
  • 3
  • 1
  • 4

Frage 35

Frage
Which of the following is correct output of “x = 12 y = 18 x = y y = x print(x,y)”?
Antworten
  • 12 18
  • 18 18
  • 12 12
  • 18 12

Frage 36

Frage
Which of the following is correct output of “x = ‘abcd’ y = 10 print(x+y)”?
Antworten
  • 10
  • abcd10
  • abcd
  • 10abcd

Frage 37

Frage
Which of the following is correct output of “colors = [‘Red’, ‘Black’, ‘White’, ‘Green’] print(colors[-2][-2])”?
Antworten
  • n
  • en
  • c
  • t

Frage 38

Frage
Which of the following statement is Python comment?
Antworten
  • *This is a Python comment
  • #This Is a Python comment
  • none of the above
  • //This is a Python comment

Frage 39

Frage
Which of the following code will add a new color ‘Black’ at the end of the list?
Antworten
  • colors.insert('black')
  • colors.add('black')
  • colors.append('black')
  • colors+=('black')

Frage 40

Frage
Which of the following expression is called for an user input?
Antworten
  • input
  • read
  • none of the above
  • for

Frage 41

Frage
Which of the following is correct output of “colors = [‘red’, ‘white’, ‘Blue’, ‘green’] print(colors[-2])?
Antworten
  • 'white'
  • 'blue'
  • 'red'
  • 'green'

Frage 42

Frage
Which of the following is correct output of “print(type([1,2,3]))”?
Antworten
  • <class 'list'>
  • <class 'tuple'>
  • <class 'set'>
  • <class 'type'>

Frage 43

Frage
Which of the following is correct about Python?
Antworten
  • python is a high-level, interpreted, interactive and object-oriented scripting language
  • python is designed to be highly readable
  • it uses English keywords frequently where as other languages use punctuation, and it has fewer syntactical constructions than other languages
  • all Of The Above

Frage 44

Frage
Is python a case sensitive language?
Antworten
  • True
  • False

Frage 45

Frage
Which of the following data types is not supported in python?
Antworten
  • numbers
  • string
  • list
  • slice

Frage 46

Frage
Which of the following data types is not supported in python?
Antworten
  • tuple
  • dictionary
  • generics
  • list

Frage 47

Frage
What is the output of print str if str = 'Hello World!'?
Antworten
  • Hello World!
  • error
  • str
  • none of the above

Frage 48

Frage
What is the output of print str[0] if str = 'Hello World!'?
Antworten
  • Hello World!
  • H
  • ello World!
  • str

Frage 49

Frage
What is the output of print str[2:5] if str = 'Hello World!'?
Antworten
  • Hello World!
  • llo World!
  • H
  • llo

Frage 50

Frage
_________________ in Python are identified as a contiguous set of characters in between quotation marks
Antworten
  • numbers
  • strings
  • list
  • tuple

Frage 51

Frage
What is the output of print list if list = [ 'abcd', 786, 2.23, 'john', 70.2]?
Antworten
  • [ 'abcd', 786, 2.23, 'john', 70.2]
  • list
  • error
  • [ 'abcd', 786, 2.23, 'john']

Frage 52

Frage
What is the output of print list[0] if list = [ 'abcd', 786, 2.23, 'john', 70.2]?
Antworten
  • [ 'abcd', 786, 2.23, 'john', 70.2]
  • list
  • error
  • [ 'abcd']

Frage 53

Frage
What is the output of print list[1:3] if list = [ 'abcd', 786, 2.23, 'john', 70.2]?
Antworten
  • [ 'abcd', 786, 2.23, 'john', 70.2]
  • list
  • [786, 2.23, 'john']
  • [ 'abcd']

Frage 54

Frage
What is the output of print list[2:] if list = [ 'abcd', 786, 2.23, 'john', 70.2]?
Antworten
  • [ 'abcd', 786, 2.23, 'john', 70.2]
  • [786, 2.23, 'john', 70.2]
  • [2.23, 'john', 70.2]
  • [ 'abcd']

Frage 55

Frage
What is the output of print tinylist * 2 if tinylist = [123, 'john']?
Antworten
  • [123, 'john', 123, 'john']
  • [123, 'john'] * 2
  • Error
  • [123]

Frage 56

Frage
Which of the following operator in python performs exponential (power) calculation on operands?
Antworten
  • **
  • //
  • is
  • not in

Frage 57

Frage
Which of the following function changes case for all letters in string?
Antworten
  • swap(old, new [, max])
  • strip([chars])
  • swapcase().
  • title()

Frage 58

Frage
What is the output of ['Hi!'] * 4?
Antworten
  • ['Hi!', 'Hi!', 'Hi!', 'Hi!']
  • ['Hi!'] * 4
  • Error
  • none of the above

Frage 59

Frage
What is the following function sorts a list?
Antworten
  • list.reverse()
  • list.sort([func])
  • list.pop(obj=list[-1])
  • list.remove(obj)

Frage 60

Frage
Following set of commands are executed in shell, what will be the output? >>>str="Hello" >>>str[:2]
Antworten
  • He
  • lo
  • olleh
  • hello

Frage 61

Frage
What kind of error occurs when you execute the following code apple = mango?
Antworten
  • Syntaxerror
  • Nameerror
  • Valueerror
  • Typeerror

Frage 62

Frage
Select all options that will correctly print “hello-how-are-you”?
Antworten
  • print(‘hello’, ‘how’, ‘are’, ‘you’)
  • print(‘hello’, ‘how’, ‘are’, ‘you’ + ‘-‘ * 4)
  • print(‘hello-‘ + ‘how-are-you’)
  • print(‘hello’, ‘how’, ‘are’)

Frage 63

Frage
What is the answer of this expression, 22 % 3?
Antworten
  • 7
  • 1
  • 0
  • 5

Frage 64

Frage
You can’t perform mathematical operation on String?
Antworten
  • True
  • False

Frage 65

Frage
Operators with the same precedence are evaluated in which manner?
Antworten
  • left to right
  • right to left

Frage 66

Frage
How will you get ‘min’ alphabetical character from the string?
Antworten
  • min(str)
  • max(str)
  • min(int)
  • lower()

Frage 67

Frage
How will you get ‘max’ alphabetical character from the string?
Antworten
  • min(str)
  • max(str)
  • min(int)
  • lower()

Frage 68

Frage
How will you convert a string to all lowercase?
Antworten
  • min(str)
  • max(str)
  • min(int)
  • lower()

Frage 69

Frage
Which of the following is invalid?
Antworten
  • _a = 1
  • __a = 1
  • __str__ = 1
  • a% = 1

Frage 70

Frage
Which of the following is an invalid variable?
Antworten
  • my_string_1
  • 1st_string
  • foo
  • alua

Frage 71

Frage
Why are local variable names beginning with an underscore discouraged?
Antworten
  • They Are Used To Indicate a Private Variables of a Class
  • They confuse the interpreter
  • They are used to indicate global variables
  • They slow down execution

Frage 72

Frage
Which of the following is not a keyword?
Antworten
  • eval
  • assert
  • nonlocal
  • pass

Frage 73

Frage
All keywords in Python are in
Antworten
  • lower case
  • upper case
  • Capitalized
  • none

Frage 74

Frage
Which of the following is true for variable names in Python?
Antworten
  • Unlimited length
  • All private members must have leading and trailing underscores
  • Underscore and ampersand are the only two special characters allowed
  • none

Frage 75

Frage
Which of the following is an invalid statement?
Antworten
  • abc = 1,000,000
  • a b c = 1000.2000.3000
  • a,b,c = 1000, 2000, 3000
  • a_b_c = 1,000,000

Frage 76

Frage
Which of the following cannot be a variable?
Antworten
  • __init__
  • in
  • it
  • on

Frage 77

Frage
What does the function re.match do?
Antworten
  • Matches a Pattern at the Start of the String
  • matches a pattern at any position in the string
  • such a function does not exist
  • none of the mentioned

Frage 78

Frage
Which of the following is incorrect?
Antworten
  • float(‘inf’)
  • float(‘nan’)
  • float(’56’+’78’)
  • float(’12+34′)

Frage 79

Frage
Int(x) means variable x is converted to integer
Antworten
  • True
  • False

Frage 80

Frage
Can You perform mathematical operation with String?
Antworten
  • Yes
  • No
  • None
  • Both

Frage 81

Frage
Which of the following logical operator is correct for definition “If both the operands are true then then condition becomes true”
Antworten
  • And
  • No correct answer
  • Not
  • In

Frage 82

Frage
Which of the following logical operator is correct for definition “If both the operands are false then then condition becomes true”
Antworten
  • And
  • No correct answer
  • Not
  • OR

Frage 83

Frage
Which of the following logical operator is correct for definition “If one of the operands is false, second is true then condition becomes false”
Antworten
  • And
  • No correct answer
  • IN
  • OR

Frage 84

Frage
Which of the following logical operator is correct for definition “If one of the operands is false, second is true then condition becomes true”
Antworten
  • And
  • No correct answer
  • IN
  • OR

Frage 85

Frage
Checks if the value of left operand is greater than the value of right operand, if yes then condition becomes true
Antworten
  • >
  • <
  • >=
  • <=

Frage 86

Frage
Checks if the value of left operand is less than the value of right operand, if yes then condition becomes true
Antworten
  • >
  • <
  • >=
  • <=

Frage 87

Frage
Checks if the value of left operand is greater than or equal to the value of right operand, if yes then condition becomes true
Antworten
  • >
  • <
  • >=
  • <=

Frage 88

Frage
Checks if the value of left operand is less than or equal to the value of right operand, if yes then condition becomes true
Antworten
  • >
  • <
  • >=
  • <=

Frage 89

Frage
Choose the correct expressing computations definition for “Get data from the keyboard, a file, or some other device”
Antworten
  • Input
  • Output
  • Maths
  • Repetition

Frage 90

Frage
Choose the correct expressing computations definition for “Display data on the screen or send data to a file or other device”
Antworten
  • Input
  • Output
  • Maths
  • Repetition

Frage 91

Frage
Choose the correct expressing computations definition for “Perform basic mathematical operations like addition and multiplication”
Antworten
  • Input
  • Output
  • Maths
  • Repetition

Frage 92

Frage
Choose the correct expressing computations definition for “Check for certain conditions and execute the appropriate code”
Antworten
  • Input
  • Output
  • Conditional logic
  • Repetition

Frage 93

Frage
Choose the correct expressing computations definition for “Perform some action repeatedly, usually with some variation”
Antworten
  • Input
  • Output
  • Maths
  • Repetition

Frage 94

Frage
Choose the correct definition for High level code
Antworten
  • Syntax a specific type of computer can understand
  • Also known as Assembly or Machine Code
  • Rare to directly create now
  • Human friendly syntax

Frage 95

Frage
_________________is a name that refers to a value
Antworten
  • Variable
  • Name
  • Value
  • Nothing

Frage 96

Frage
_______________________is used to create variables and to give them values
Antworten
  • Assignment statement
  • Variable
  • Naming
  • Statement

Frage 97

Frage
We can use the ______________ function to check the type of a variable
Antworten
  • Type()
  • Check()
  • Variable()
  • Str()

Frage 98

Frage
We can alter the type of a variable using the following functions, which is “converts variable to a string”
Antworten
  • Type()
  • Int()
  • Float()
  • Str()

Frage 99

Frage
We can alter the type of a variable using the following functions, which is “converts variable to a integer”
Antworten
  • Type()
  • Int()
  • Float()
  • Str()

Frage 100

Frage
We can alter the type of a variable using the following functions, which is “converts variable to a float”
Antworten
  • Type()
  • Int()
  • Float()
  • Str()

Frage 101

Frage
Choose the keyword that cannot be used as names for variables as they already have a meaning and purpose.
Antworten
  • def
  • definition
  • purpose
  • printing

Frage 102

Frage
Lists are a commonly used, simple compound data type in Python, choose the correct answer for “index starts at 0”
Antworten
  • mylist[0]
  • mylist[-1]
  • mylist[2:4]
  • mylist[1]

Frage 103

Frage
Lists are a commonly used, simple compound data type in Python, choose the correct answer for “reversing from the last value”
Antworten
  • mylist[0]
  • mylist[-1]
  • mylist[2:4]
  • mylist[1]

Frage 104

Frage
Lists are a commonly used, simple compound data type in Python, choose the correct answer for “subset of the values”
Antworten
  • mylist[0]
  • mylist[-1]
  • mylist[2:4]
  • mylist[1]

Frage 105

Frage
in python we use data type, that has keys with values called?
Antworten
  • Lists
  • Dictionaries
  • Dairies
  • Compounds

Frage 106

Frage
There is dictionary called telnumbers = {‘john’: 756, ‘mike’: 789, ‘alex’: 456, ‘sue’: 123}, how to print everything from the dictionary?
Antworten
  • print numbers
  • telnumbers
  • telnumbers[‘alex’]
  • telnumbers.keys()

Frage 107

Frage
There is dictionary called telnumbers = {‘john’: 756, ‘mike’: 789, ‘alex’: 456, ‘sue’: 123}, how to print dictionary keys?
Antworten
  • print numbers
  • telnumbers
  • telnumbers[‘alex’]
  • telnumbers.keys()

Frage 108

Frage
There is dictionary called telnumbers = {‘john’: 756, ‘mike’: 789, ‘alex’: 456, ‘sue’: 123}, how to print Alex’s telephone number?
Antworten
  • print numbers[‘alex’]
  • telnumbers
  • telnumbers[‘alex’]
  • telnumbers.keys()

Frage 109

Frage
There is dictionary called telnumbers = {‘john’: 756, ‘mike’: 789, ‘alex’: 456, ‘sue’: 123}, which of the following is the dictionary key?
Antworten
  • ‘john’
  • 756
  • 'alua’
  • numbers.keys

Frage 110

Frage
There is dictionary called telnumbers = {‘john’: 756, ‘mike’: 789, ‘alex’: 456, ‘sue’: 123}, which of the following is the dictionary value?
Antworten
  • ‘john’
  • 756
  • ‘456’
  • numbers.keys

Frage 111

Frage
choose the correct definition for ‘syntax error’
Antworten
  • The structure or tokens in the code are wrong
  • An operation is applied to data of the wrong type
  • Referring to a variable that has not been assigned a value
  • None of the mentioned

Frage 112

Frage
choose the correct definition for ‘type error’
Antworten
  • The structure or tokens in the code are wrong
  • An operation is applied to data of the wrong type
  • Referring to a variable that has not been assigned a value
  • None of the mentioned

Frage 113

Frage
choose the correct definition for ‘name error’
Antworten
  • The structure or tokens in the code are wrong
  • An operation is applied to data of the wrong type
  • Referring to a variable that has not been assigned a value
  • None of the mentioned

Frage 114

Frage
Functions must be defined ___________ they can be called?
Antworten
  • After
  • Before
  • Instead
  • With def keyword

Frage 115

Frage
Which of the following is the use of function in python?
Antworten
  • Functions are reusable pieces of programs
  • Functions don’t provide better modularity for your application
  • you can’t also create your own functions
  • All of the mentioned

Frage 116

Frage
Which keyword is use for function?
Antworten
  • Fun
  • Define
  • Def
  • Function

Frage 117

Frage
What is the output of the below program ?
Antworten
  • Hello World! Hello World!
  • ‘Hello World!’ ‘Hello World!’
  • Hello Hello
  • None of the mentioned

Frage 118

Frage
What is the output of the below program ?
Antworten
  • 3
  • 4
  • 4 is maximum
  • 3 is maximum

Frage 119

Frage
What is the output of the below program ?
Antworten
  • x is 50 Changed global x to 2 Value of x is 50
  • x is 50 Changed global x to 2 Value of x is 2
  • x is 50 Changed global x to 50 Value of x is 50
  • x is 50 Changed global x to 50 Value of x is 2

Frage 120

Frage
Which are the advantages of functions in python?
Antworten
  • Reducing duplication of code
  • Decomposing complex problems into simpler pieces
  • Improving clarity of the code
  • All of the mentioned

Frage 121

Frage
What are the two types of functions?
Antworten
  • Custom function and Built-in function
  • Built-in function and User-Defined function
  • Custom function and System function
  • System function and User-Defined function

Frage 122

Frage
Where is function defined?
Antworten
  • Module
  • Class
  • Another function
  • All of the mentioned

Frage 123

Frage
What is the output of below program ?
Antworten
  • 3
  • 9
  • 27
  • 333

Frage 124

Frage
What is the output of below program ?
Antworten
  • 432
  • 230400
  • 24000
  • 430

Frage 125

Frage
What are the keys? for d = {"john":40, "peter":45}
Antworten
  • “john”, 40, 45, and “peter”
  • “john” and “peter”
  • 40 and 45
  • d = (40:”john”, 45:”peter”)

Frage 126

Frage
What will be the output ?
Antworten
  • True
  • False
  • Error
  • None

Frage 127

Frage
What will be the output ?
Antworten
  • True
  • False
  • Error
  • None

Frage 128

Frage
What will be the output
Antworten
  • True
  • False
  • Error
  • None

Frage 129

Frage
What is the output for code? >> d = {"john":40, "peter":45} >> d["john"]
Antworten
  • 40
  • 45
  • John 40
  • Peter 45

Frage 130

Frage
Suppose d = {“john”:40, “peter”:45}, what happens when retieving a value using d[“susan”]?
Antworten
  • Since “susan” is not a value in the set, Python raises a KeyError exception.
  • It is executed fine and no exception is raised, and it returns None.
  • Since “susan” is not a key in the set, Python raises a KeyError exception.
  • Since “susan” is not a key in the set, Python raises a syntax error.

Frage 131

Frage
Choose the correct expressing computations definition for “Display data on the screen or send data to a file or other device”
Antworten
  • Input
  • Output
  • Maths
  • Repetition

Frage 132

Frage
Choose the correct expressing computations definition for “Perform basic mathematical operations like addition and multiplication”
Antworten
  • Input
  • Output
  • Maths
  • Repetition

Frage 133

Frage
Choose the correct expressing computations definition for “Check for certain conditions and execute the appropriate code”
Antworten
  • Input
  • Output
  • Conditional logic
  • Repetition

Frage 134

Frage
Choose the correct expressing computations definition for “Perform some action repeatedly, usually with some variation”
Antworten
  • Input
  • Output
  • Maths
  • Repetition

Frage 135

Frage
Choose the correct definition for High level code
Antworten
  • Syntax a specific type of computer can understand
  • Also known as Assembly or Machine Code
  • Rare to directly create now
  • Human friendly syntax

Frage 136

Frage
_________________is a name that refers to a value
Antworten
  • Variable
  • Name
  • Value
  • Nothing

Frage 137

Frage
_______________________is used to create variables and to give them values
Antworten
  • Assignment statement
  • Variable
  • Naming
  • Statement

Frage 138

Frage
We can use the ______________ function to check the type of a variable
Antworten
  • Type()
  • Check()
  • Variable()
  • Str()

Frage 139

Frage
We can alter the type of a variable using the following functions, which is “converts variable to a string”
Antworten
  • Type()
  • Int()
  • Float()
  • Str()

Frage 140

Frage
We can alter the type of a variable using the following functions, which is “converts variable to a integer”
Antworten
  • Type()
  • Int()
  • Float()
  • Str()

Frage 141

Frage
We can alter the type of a variable using the following functions, which is “converts variable to a float”
Antworten
  • Type()
  • Int()
  • Float()
  • Str()

Frage 142

Frage
Choose the keyword that cannot be used as names for variables as they already have a meaning and purpose.
Antworten
  • def
  • definition
  • purpose
  • printing

Frage 143

Frage
Lists are a commonly used, simple compound data type in Python, choose the correct answer for “index starts at 0”
Antworten
  • mylist[0]
  • mylist[-1]
  • mylist[2:4]
  • mylist[1]

Frage 144

Frage
Lists are a commonly used, simple compound data type in Python, choose the correct answer for “reversing from the last value”
Antworten
  • mylist[0]
  • mylist[-1]
  • mylist[2:4]
  • mylist[1]

Frage 145

Frage
Lists are a commonly used, simple compound data type in Python, choose the correct answer for “subset of the values”
Antworten
  • mylist[0]
  • mylist[-1]
  • mylist[2:4]
  • mylist[1]

Frage 146

Frage
in python we use data type, that has keys with values called?
Antworten
  • Lists
  • Dictionaries
  • Dairies
  • Compounds

Frage 147

Frage
There is dictionary called telnumbers = {‘john’: 756, ‘mike’: 789, ‘alex’: 456, ‘sue’: 123}, how to print everything from the dictionary?
Antworten
  • print numbers
  • telnumbers
  • telnumbers[‘alex’]
  • telnumbers.keys()

Frage 148

Frage
There is dictionary called telnumbers = {‘john’: 756, ‘mike’: 789, ‘alex’: 456, ‘sue’: 123}, how to print dictionary keys?
Antworten
  • print numbers
  • telnumbers
  • telnumbers[‘alex’]
  • telnumbers.keys()

Frage 149

Frage
There is dictionary called telnumbers = {‘john’: 756, ‘mike’: 789, ‘alex’: 456, ‘sue’: 123}, how to print Alex’s telephone number?
Antworten
  • print numbers[‘alex’]
  • telnumbers
  • telnumbers[‘alex’]
  • telnumbers.keys()

Frage 150

Frage
There is dictionary called telnumbers = {‘john’: 756, ‘mike’: 789, ‘alex’: 456, ‘sue’: 123}, which of the following is the dictionary key?
Antworten
  • ‘john’
  • 756
  • ‘alua’
  • numbers.keys

Frage 151

Frage
There is dictionary called telnumbers = {‘john’: 756, ‘mike’: 789, ‘alex’: 456, ‘sue’: 123}, which of the following is the dictionary value?
Antworten
  • ‘john’
  • 756
  • ‘456’
  • numbers.keys

Frage 152

Frage
choose the correct definition for ‘syntax error’
Antworten
  • The structure or tokens in the code are wrong
  • An operation is applied to data of the wrong type
  • Referring to a variable that has not been assigned a value
  • None of the mentioned

Frage 153

Frage
choose the correct definition for ‘type error’
Antworten
  • The structure or tokens in the code are wrong
  • An operation is applied to data of the wrong type
  • Referring to a variable that has not been assigned a value
  • None of the mentioned

Frage 154

Frage
choose the correct definition for ‘name error’
Antworten
  • The structure or tokens in the code are wrong
  • An operation is applied to data of the wrong type
  • Referring to a variable that has not been assigned a value
  • None of the mentioned

Frage 155

Frage
Functions must be defined ___________ they can be called?
Antworten
  • After
  • Before
  • Instead
  • With def keyword

Frage 156

Frage
Which of the following is the use of function in python?
Antworten
  • Functions are reusable pieces of programs
  • Functions don’t provide better modularity for your application
  • you can’t also create your own functions
  • All of the mentioned

Frage 157

Frage
Which keyword is use for function?
Antworten
  • Fun
  • Define
  • Def
  • Function

Frage 158

Frage
What is the output of the below program ?
Antworten
  • Hello World! Hello World!
  • ‘Hello World!’ ‘Hello World!’
  • Hello Hello
  • None of the mentioned

Frage 159

Frage
What is the output of the below program ?
Antworten
  • 3
  • 4
  • 4 is maximum
  • 3 is maximum

Frage 160

Frage
What is the output of the below program ?
Antworten
  • x is 50 Changed global x to 2 Value of x is 50
  • x is 50 Changed global x to 2 Value of x is 2
  • x is 50 Changed global x to 50 Value of x is 50
  • x is 50 Changed global x to 50 Value of x is 2

Frage 161

Frage
Which are the advantages of functions in python?
Antworten
  • Reducing duplication of code
  • Decomposing complex problems into simpler pieces
  • Improving clarity of the code
  • All of the mentioned

Frage 162

Frage
What are the two types of functions?
Antworten
  • Custom function and Built-in function
  • Built-in function and User-Defined function
  • Custom function and System function
  • System function and User-Defined function

Frage 163

Frage
Where is function defined?
Antworten
  • Module
  • Class
  • Another function
  • All of the mentioned

Frage 164

Frage
What is the output of below program ?
Antworten
  • 3
  • 9
  • 27
  • 333

Frage 165

Frage
What is the output of below program ?
Antworten
  • 432
  • 230400
  • 24000
  • 430

Frage 166

Frage
What are the keys? for d = {"john":40, "peter":45}
Antworten
  • “john”, 40, 45, and “peter”
  • “john” and “peter”
  • 40 and 45
  • d = (40:”john”, 45:”peter”)

Frage 167

Frage
What will be the output ?
Antworten
  • True
  • False
  • Error
  • None

Frage 168

Frage
What will be the output ?
Antworten
  • True
  • False
  • Error
  • None

Frage 169

Frage
What will be the output ?
Antworten
  • True
  • False
  • Error
  • None

Frage 170

Frage
What is the output for code? >> d = {"john":40, "peter":45} >> d["john"]
Antworten
  • 40
  • 45
  • John 40
  • Peter 45

Frage 171

Frage
Suppose d = {“john”:40, “peter”:45}, what happens when retieving a value using d[“susan”]?
Antworten
  • Since “susan” is not a value in the set, Python raises a KeyError exception.
  • It is executed fine and no exception is raised, and it returns None.
  • Since “susan” is not a key in the set, Python raises a KeyError exception.
  • Since “susan” is not a key in the set, Python raises a syntax error.

Frage 172

Frage
What is the output of the below program ?
Antworten
  • x is 50 Changed global x to 2 Value of x is 50
  • x is 50 Changed global x to 2 Value of x is 2
  • x is 50 Changed global x to 50 Value of x is 50
  • x is 50 Changed global x to 50 Value of x is 2

Frage 173

Frage
Which are the advantages of functions in python?
Antworten
  • Reducing duplication of code
  • Decomposing complex problems into simpler pieces
  • Improving clarity of the code
  • All of the mentioned

Frage 174

Frage
What are the two types of functions?
Antworten
  • Custom function and Built-in function
  • Built-in function and User-Defined function
  • Custom function and System function
  • System function and User-Defined function

Frage 175

Frage
Where is function defined?
Antworten
  • Module
  • Class
  • Another function
  • All of the mentioned

Frage 176

Frage
What is the output of below program ?
Antworten
  • 3
  • 9
  • 27
  • 333

Frage 177

Frage
What is the output of below program ?
Antworten
  • 432
  • 230400
  • 24000
  • 430

Frage 178

Frage
What are the keys? for d = {"john":40, "peter":45}
Antworten
  • “john”, 40, 45, and “peter”
  • “john” and “peter”
  • 40 and 45
  • d = (40:”john”, 45:”peter”)

Frage 179

Frage
What will be the output ?
Antworten
  • True
  • False
  • Error
  • None

Frage 180

Frage
What will be the output ?
Antworten
  • True
  • False
  • Error
  • None
Zusammenfassung anzeigen Zusammenfassung ausblenden

ähnlicher Inhalt

Gedichtanalyse
AntonS
Latein Grundwortschatz Vokabeln
anna.grillborzer0656
HTML Quiz - Grundlagen
Alexander T
Shakespeare
Antonia C
Bildungswissenschaft
Yvonne Heitland
MVB ASVG B-KUVG GSVG
Bianca Guggenberger
WT1 Uni Due
Awash Kaul
Vetie Mikrobiologie 2010
Juliane Arendt
AVO & Klinische Pharmakologie 2013
Schmolli Schmoll
Vetie Fleisch 2021
Mascha K.