wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

энгглиш 1

Total questions: 120

Worksheet time: 1hrs 11mins

Name
Class
Date
1.

               What symbol is used to indicate a comment in Python?

a)

//

b)

b) /* */

c)

d) --

d)

c) #

2.

               How to declare a variable in Python?

a)

b) x = 10

b)

c) int x = 10

c)

a) var x = 10

d)

d) declare x = 10

3.

             Which operator is used to raise a number to a power?

a)

a) ^

b)

b) **

c)

c) *

d)

d) ^^

4.

              How to display text on screen in Python?

a)

a) display ("Hello")

b)

c) print ("Hello")

c)

d) printf ("Hello")

d)

b) echo "Hello"

5.

                How to check the type of a variable in Python?              

a)

a) typeOf (x)

b)

b) typeof (x)

c)

d) checkType (x)

d)

c) type (x)

6.

              What is a list in Python?

a)

a) Ordered collection of elements

b)

c) Key-value collection

c)

b) Unordered collection of elements

d)

d) Data type for storing a single value

7.

list ()

a)

a) list ()

b)

c) empty_list ()

c)

d) new_list ()

d)

b) []

8.

1.                 How to get the length of a list?

a)

c) len ( list )

b)

b) size ( list )

c)

a) list.size ()

d)

d) length ( list )

9.

1.                 Which method is used to add an element to the end of a list?

a)

a) add ()

b)

c) append ()

c)

d) push ()

d)

b) insert ()

10.

1.                 How to remove an element from a list by index?

a)

c) del list [ index ]

b)

b) delete ( index )

c)

a) remove ( index )

d)

d) pop ( index )

11.

11.             Which function is used to enter data from the keyboard?

a)

b) read ()

b)

a) input ()

c)

c) get ()

d)

d) scan ()

12.

11.             What data type is used to store integers?

a)

a)     long

b)

a)     integer

c)

a)     number

d)

a)     int

13.

11.             How to create a condition in Python?

a)

a)     condition {

b)

a)     when condition :

c)

a)     if condition :

d)

a)     if ( condition )

14.

11.             Which operators are not used to compare values?

a)

a)     <> 

b)

a)     !=

c)

a)     **

d)

a)     ==

15.

11.             Which of the following data types are mutable ?

a)

a)     lista)     list

b)

a)     str

c)

a)     float

d)

a)     int

16.

11.             What symbols are used to create a block of code in Python?

a)

a)     ()

b)

a)     <> 

c)

a)     {}

d)

a)     []

17.

11.             Which of the following methods is not used to manipulate strings?

a)

a)     upper ()

b)

a)     split ()

c)

a)     append ()

d)

a)     title( )

18.

11.             What loop is used to iterate through the elements in a list?

a)

a)     while

b)

a)     repeat

c)

a)     for-in

d)

a)     loop

19.

11.             How to convert a string to an integer?

a)

a)     toInt ( string )

b)

a)     parse ( int , string )

c)

a)     str2int( string )

d)

a)     int ( string )

20.

11.             How to display list elements in reverse order?

a)

a)     reverse ( list )

b)

a)     flip ( list )

c)

a)     list.reverse ()

d)

a)     reverseList ( list )

21.

11.             What is the result of performing the operation 3 + 5 * 2?

a)

a)     16

b)

a)     13

c)

a)     eleven

d)

a)     26

22.

11.             How to create a list in Python?

a)

a)     array = (1, 2, 3)

b)

a)     set = {1, 2, 3}

c)

a)     list = [1, 2, 3]

d)

a)     tuple = (1, 2, 3)

23.

11.             How to get the length of a list?

a)

a)     len ( list )

b)

a)     count ( list )

c)

a)     length ( list )

d)

a)     size ( list )

24.

11.             Which method is used to add an element to the end of a list?

a)

a)     list.append (4)

b)

a)     list.insert (4)

c)

a)     list.add (4)

d)

a)     list.extend (4)

25.

11.             What does an if statement do in Python?

a)

a)                 Creates a loop

b)

a)                 Executes a block of code if the condition is true

c)

a)                 Prints text on the screen

d)

a)                 Defines a function

26.

11.             What is the result of running range (3) ?

a)

a)     [0, 1, 2]

b)

a)     [1, 2, 3]

c)

a)     (1, 2, 3)

d)

a)     (0, 1, 2)

27.

11.             How to read user input from keyboard?

a)

a)     keyboard ()

b)

a)     read ()

c)

a)     get ()

d)

a)     input ()

28.

11.             Which operator is used to concatenate two strings?

a)

a)     &

b)

a)     *

c)

a)     +

d)

a)     /

29.

11.             Which operator is used to test equality in Python?

a)

a)                 !=

b)

a)                 < 

c)

a)                 =

d)

a)                 ==

30.

11.             Which loop is used to execute a block of code a certain number of times?

a)

B. for

b)

A. if

c)

C. while

d)

D. loop

31.

11.             What is "pseudocode"?

a)

. Real Python Code

b)

C. Mark for comments in code

c)

B. A language for describing algorithms, close to structured programming

d)

Programming language

32.

11.             How to create an "if x is greater than 10" condition in Python?

a)

if x => 10:

b)

D. if x < 10:

c)

C. if x = 10:

d)

A. if x > 10:

33.

11.             How to add a check for three conditions in Python?

a)

A. if x > 0 and x < 10:

b)

B. if x > 0 or x < 10:

c)

C. if x > 0, x < 10:

d)

D. if x > 0 && x < 10:

34.

11.             How to create a list ( list ) in Python?

a)

D.list (1 2 3) ;D.list (1 2 3) ;

b)

C. list (1, 2, 3);

c)

B. list = [1, 2, 3];

d)

A. list = {1, 2, 3};

35.

11.             What is the "efficiency" of an algorithm?

a)

A. Algorithm execution speed

b)

C. Text color in comments

c)

D. Program File Size

d)

B. Number of lines of code

36.

11.             What is an index in Python?

a)

A. Phone book number

b)

C. Character Encoding

c)

B. The ordinal number of the element in the sequence

d)

D. Unique variable identifier

37.

Which loop is used to execute a block of code while a condition is true?

a)

A. if

b)

D. loop

c)

C. while

d)

B. for

38.

11.             What will be the result of running the following code:

a)

x = 7

if x < 5: print ("Not enough")

else : print ("A lot")

b)

B. "A lot"

c)

A. "Not enough"

d)

D. Runtime error

39.

11.             What is "breaking" a loop?

a)

a.                  Error in loop

b)

a.                  Premature termination of the cycle

c)

a.                  Print an error message

d)

a.                  Changing a variable in a loop

40.

11.             What is the result of running this code: 5 + 3 * 2?

a)

a.                  16

b)

a.                  26

c)

a.                  10

d)

a.                  eleven

41.

11.             How to break the loop if x reaches the value 5?

a)

a.                  break if x == 5

b)

a.                  terminate x == 5

c)

a.                  if x == 5: break

d)

a.                  stop when x == 5

42.

11.             What does a while loop do ?

a)

  Executes a block of code a specified number of times

b)

a.                  Starts an infinite loop

c)

a.                  Loops through the elements of a sequence

d)

Executes a block of code while the condition is true

43.

11.             int variable :

a)

a)                 boolean variable

b)

character string

c)

a)                 integer variable

d)

a)                 real variable

44.

11.             float variable :

a)

a)                 real variable

b)

a)                 boolean variable

c)

a)                 character string

d)

a)                 integer variable

45.

11.             Variable str :

a)

a)                 real variable

b)

a)                 integer variable

c)

a)                 boolean variable

d)

a)                 character string

46.

11.             bool variable :

a)

a)                 character string

b)

a)                 real variable

c)

a)                 integer variable

d)

a)                 boolean variable

47.

11.             Variable names cannot include:

a)

a)                 Russian letters

b)

a)                 Spaces

c)

a)                 Letters

d)

a)                 Numbers

48.

11.             What names are incorrect in PYTHON

a)

a)                 G_M

b)

a)                 ABC

c)

a)                 41N

d)

a)                 Game2

49.

11.             An algorithm in which actions are performed depending on the truth of a condition is called:

a)

a)                 linear

b)

a)                 cyclical

c)

a)                 branching

d)

a)                 vector

50.

11.             An algorithm in which actions are performed sequentially one after another is called

a)

a)                 vector

b)

a)                 linear

c)

a)                 branching

d)

a)                 cyclical

51.

11.             An algorithm in which a certain sequence of actions is performed repeatedly is called

a)

a)                 linear

b)

a)                 vector

c)

a)                 branching

d)

a)                 cyclical

52.

11. What data type in Python represents integers?

a)

a)     complex

b)

a)     bool.

c)

a)     int

d)

a)     float

53.

Which of the following number literals are of type float ?

a)

a)     1.7+4.3j

b)

a)     88

c)

a)     -4

d)

a)      5.0

54.

11. What will be displayed on the screen as a result of executing the conditional code? x = 5 y = 2 z = x // y print ( z )

a)

a)     2

b)

a)     3

c)

a)     2.5

d)

a)     error.

55.

11.             What will be printed on the screen as a result of executing the print ( 4 + 3.0) statement?

a)

a)     7

b)

a)     error

c)

a)     4+3.0

d)

a)     7.0

56.

11. What will be displayed on the screen as a result of executing the conditional code? x = 5 y = 2 z = x % y print ( z )

a)

a)     error.

b)

4

c)

a)     1

d)

a)     3

57.

11. What will be displayed on the screen as a result of executing the conditional code? x = 5 x += x – x    print ( x )

a)

a)     0

b)

a)     error.

c)

b)    10

d)

a)     5

58.

What will be displayed on the screen as a result of executing the conditional code? x = 3 y = 3.0 z = '3' print ( x + y + z )

a)

a)     error.

b)

a)     10

c)

a)     0

d)

a)     5

59.

11.             What will be printed on the screen as a result of executing the print ( 5**(5 - 2)) statement?

a)

a)     Error

b)

a)     15

c)

a)     45.0

d)

a)     125

60.

11.             Which operator is used to get the remainder of division in Python?

a)

a)     %

b)

a)     //

c)

a)     **

d)

a)     /

61.

11. What will be displayed on the screen as a result of executing the conditional code? x = '7' y = '3' z = x + y    print ( z )

a)

a)     7+3

b)

a)     Error

c)

a)     10

d)

a)     73

62.

11. What does the len ( ) function return when passed a string?

a)

a)     word count

b)

a)     number of bytes

c)

a)     Characters

d)

a)     error

63.

11. How to add an elem element to the end of a li list ?

a)

a)     li.append ( elem )

b)

a)     li += [ elem ]

c)

a)     li.insert ( len (li), elem )

d)

a)     li.extend ([ elem ])

64.

How to remove the element elem from a list li by its index i?

a)

a)     li.pop ( i )

b)

a)     li. clear ( )

c)

a)     li.append ( i )

d)

a)     li.remove ( elem )

65.

Dan list li = ['a', 'b', 'cd', 'e', 'f']. List the instructions that will display the symbol d.

a)

a)     print( li[ -3][1])

b)

a)     print( li[ 2][2])

c)

a)     print( li[ 3])

d)

a)     print( li[ 2][1])

66.

11. What data type represents tuples in Python?

a)

set

b)

a)     dict

c)

a)     list

d)

a)     tuple

67.

11. What will be displayed on the screen as a result of executing the conditional code? d = {1: 'a', '2': ['b', {'c': 3}], (5, '6'): ('f', 'g' )} print ( len ( d ))

a)

4

b)

3

c)

10

d)

2

68.

11. The algorithm is:

a)

11. The algorithm is:a)     a system of rules that describes the sequence of actions that must be performed to solve a problem

b)

a program designed to create and process graphic information

c)

a)     step-by-step description of the sequence of actions that must be performed to solve the problem;

d)

a)     description of the properties and patterns of behavior of objects that are essential for the task at hand, ensuring its solution;

69.

11. How many basic algorithm structures do you know?

a)

2

b)

5

c)

3

d)

4

70.

One of the properties of the algorithm:

a)

a)     efficiency

b)

a)     operationality

c)

a)     mass character

d)

a)     cyclicality

71.

11. The algorithm must consist of separate steps, as the property is called:

a)

a)     About ambiguity

b)

a)     Mass character

c)

a)     Limb

d)

a)     Discreteness

72.

1.      Jupyter Notebooks have code cells and markdown cells.

a)

False

b)

TRUE

73.

1.      Which is a valid Python code comment?

a)

·        (comment) warnings can be placed in comments.

b)

·        // comments make code easier to update.

c)

·        # use comments to describe the function of code.

d)

·        [comment] comments can provide use instructions for other developers.

74.

1.      Choose the correct statement

a)

D.    New variables always start out as zero.

b)

The same variable in Python can be represented in either upper or lower case

c)

A.    Variables only represent strings in Python.

d)

C.    Variables in Python can be initialized using the equals sign (=).

75.

1.      The type() function is used to change from one data type to another

a)

FALSE

b)

TRUE

76.

What does type("Hello World!") return?

a)

  all of the below

b)

       int

c)

str

d)

float

77.

1.      What does the Python code: score = 3 + "45" result in?

a)

48

b)

TypeError

c)

345

d)

type()

78.

1.      def show_name():
    print("Tobias Ledford")

Which code calls the function in the above code?

a)

·        show_name()

b)

·        show_name.run()

c)

·        run show_name

d)

·        open(show_name)

79.

1.      def add_num(num_1 = 10):
    print(num_1 + num_1)

Choose the correct output of calling the above function using the following code:

add_num()

a)

0

b)

20

c)

10

d)

·        An Error

80.

1.      def low_case(words_in):
    return words_in.lower() 

 

Choose the correct output of calling the function above using the following code:

words_lower = low_case("Return THIS lower")
print(words_lower)

a)

·        "return this lower"

b)

·        An Error

c)

·        "Return THIS lower"

d)

·        No Output

81.

1.       

 
if hot_plate:
   

    print("Be careful, hot plate!")

else:
       print("The plate is ready.")

What is the output from running the above code?

a)

·        "Be careful, hot plate!"

b)

·        "True"

c)

·        "The plate is ready."

d)

·        NameError

82.

1.      vehicle_type = "Truck"


if vehicle_type.upper().startswith("P"):
   

    print(vehicle_type, 'starts with "P"')

else:
   

    print(vehicle_type, 'does not start with "P"')

What is the output from running the above code?

a)

·        "False"

b)

·        "True"

c)

·        "Truck starts with "P""

d)

·        "Truck does not start with "P"''

83.

1.      if True:
    if False:
        print("Banana")
    else:
        print("Apple")
else:
    if True:
        print("Dates")
    else:
        print("Corn")
 

What is the output of the above code?

a)

Apple

b)

Banana

c)

Corn

d)

Dates

84.

1.      x = 0

while True:
    if x < 10:
        print('run forever')
        x += 1
    else:
        break
 

What is the output from running the above code most like?

a)

·        "run forever"

b)

·        No output

c)

·        "run forever" (10 times)

d)

·        "run forever" (9 times)

85.

1.      Which statement best describes a String in Python/Computer Science?

a)

·        object existing in four dimensions

b)

·        sequence of characters

c)

·        computer keyboard

d)

·        series of 1's and 0's

86.

1.      Choose the statement that will print the letter "d", given the variable declaration word = "windows"

a)

·         print(word[3])

b)

·         print(word[-2])

c)

·         print(word[2])

d)

·         print(word[-1])

87.

1.      Which choice will print the word "tac", given the following variable declaration?

word = "cat"

a)

·        print(word[2:1:0])

b)

·        print(word[::1])

c)

·        print(word[0:1:2])

d)

·        print(word[::-1])

88.

1.      Which choice best represents the output of the following code?

student_name = "iteration"
count = 0
for letter in student_name:
    if letter.lower() == "e":
        print(count)
    count += 1

a)

·        "-4"

b)

·        "3"

c)

·        "-5"

d)

·        "2"

89.

1.      Which string method returns an index of first character or substring matches?

a)

·        while

b)

·        .find()

c)

·        .count()

d)

·        .isalpha()

90.

1.      Which choice is a valid Python code to store the length of the given string variable 'word' below in 'x'?

word = "Python"

a)

·        for x in length of word

b)

·        x.length(word)

c)

·        x = len(word)

d)

·        x = word.len()

91.

1.      What data type is this?
quiz = {"Do you help out at home? ":"yes",        
"Do you beleive in Santa? ":"yes"}

a)

·        string

b)

·        dictionary

c)

·        list

d)

·        tuple

92.

1.      Which symbol surrounds a dictionary?

a)

·        :

b)

·        {

c)

·        [

d)

·        (

93.

1.      What is the output of this code?

dl={1:10, 2:20, 3:30, 4:40}

d2={5:50, 6:60, 7:70}

dl.update (d2)

print (dl)

a)

·        {1: 10, 2: 20, 3: 30, 4: 40, 5: 50, 6: 60, 7: 70}

b)

·        [1: 10, 2: 20, 3: 30, 4: 40, 5: 50, 6: 60, 7: 70]

c)

·        [(1, 10), (2, 20), (3, 30), (4, 40), (5, 50)]

d)

·        {1:10, 2: 20, 4: 40, 5: 50, 6: 60, 7: 70}

94.

1.      What is the output of the code?

dl={1:10, 2:20,3:30, 4:40, 5:50, 6:60,7:70}

d1.pop (5)

a)

5

b)

60

c)

·        6

d)

·        50

95.

1.      What is the output of the code?

d1 = {1:10, 2:20, 3:30, 4:40, 5:50, 6:60, 7:70}

del d1 [3]

print (d1)

a)

·         {3: 30}

b)

·         {1:10, 2: 20, 4: 40, 5: 50, 6: 60, 7: 70}

c)

{4: 40}

d)

·         {1:10, 2: 20, 3: 30, 5: 50, 6: 60, 7: 70}

96.

1.     What is a Python library created for mathematical operations?

a)

·        Spacy

b)

·        Pandas

c)

·        Numpy

d)

·        Sklearn

97.

1.     What is the name of the function used to create an array?

a)

·        np.tuple()

b)

·        np.array()

c)

·        np.list()

d)

·        np.arange()

98.

1.     What is the use of zeros() function in Numpy array in python?

a)

·        To make an empty Matrix

b)

·        To make a Matrix with all diagonal element 0

c)

·        To make a Matrix with first row 0

d)

·        To make a Matrix with all element 0

99.

1.     What is an output of np.arange(2,8,1)?

a)

·        2,3,4,5,6,7

b)

·        2,3,4,5,6

c)

·        2,3,4,5,6,7,8

d)

·        2,4,6,8

100.

1.     Which of the following find the maximum number in the Numpy array?

a)

max_array()

b)

array_max()

c)

max(array)

d)

array(max)

101.

1.     What is the output of the following operations?

names = np.array(["Reem" , "Salah" , "Haya" , "Maryam" , "Fatema"])

print(names[[2,3,4]])

a)

·        [ 'Haya' 'Maryam' 'Fatema' ]

b)

·        [ 'Reem' 'Salah' 'Haya' ]

c)

·        [ 'Maryam' 'Haya' 'Fatema' ]

d)

·        [ 'Reem' 'Salah' 'Fatema' ]

102.

1.     What is a correct method to join two or more arrays?

a)

·        np.join()

b)

·        np.concatenate()

c)

·        np.combine()

d)

·        np.merge()

103.

1.     What is the output of the code?

import numpy as np

a = np.array([[0, 1, 2], [3, 4, 5]])

b = a.sum(axis=0)

print (b)

a)

·        [1 5 6]

b)

·        [0 5 7]

c)

·        [3 5 7]

d)

·        [3 4 6]

104.

1.     What is the correct method to sort the elements of an array?

a)

np.split()

b)

np.add()

c)

np.sort()

d)

np.reverse()·       

105.

1.     Each location of an element in an array is called _____

a)

·        Length

b)

·        Element

c)

·        Index

d)

·        Size

106.

1.     What is the most popular open-source Python library used for doing data analysis?

a)

·        Pandas

b)

·        Matplotlib

c)

Numpy

107.

What are the two basic and universally-popular data structures of Pandas?

a)

·        Series and DataFrame

b)

·        Series and Pandas

c)

·        Numpy and DataFrame

108.

1.     In a data frame axis -0 is for _____

a)

·        Rows

b)

·        None of these

c)

·        Rows and Columns both

d)

·        Columns

109.

1.     Which method applies the function on each individual data element of the dataframe?

a)

·        plot()

b)

·        apply()

c)

·        hist()

d)

·        bar()

110.

1.     Selecting a single column from a DataFrame object returns:

a)

·        A Series

b)

·        A list

c)

·        Another DataFrame

d)

·        A numpy array

111.

1.     What happens when you multiply a DataFrame like df * 2?:

a)

·        Returns a DataFrame with the rows doubled

b)

·        Raises a "bad operand type" error

c)

·  ·        Returns a DataFrame with element-wise application of df * 2

d)

·        Returns a DataFrame with the columns doubled

112.

1.     Which of these will not select the column named foo from DataFrame df?:

a)

·        df.foo

b)

·        df.loc[:, 'foo']

c)

·        df['foo']

d)

·        df.iloc[:, 'foo']

113.

1.     Which function from the options given below can read the dataset from a large text file?

a)

·        read_pickle

b)

·        read_csv

c)

·        read_hdf

d)

·        read_json

114.

1.     In Dataframe, loc function is used to choose ____

a)

·        all of them

b)

·        cells

c)

·        rows

d)

·        columns

115.

In Dataframe, a function used to find NaN values is ____

a)

·        isnull()

b)

·       isempty()

c)

·        isfull()

d)

·        isno()

116.

1.     Python library used for data visualization is called

a)

·        tensorflow

b)

·        matplotlib

c)

·        keras

d)

·        sklearn

117.

1.     What will this command plt.title('String Title Here') do?

a)

·        Set a name of x axis

b)

·        Set a color of the graphic

c)

·        Set a header of the graphic

d)

·        Set a legend of the graphic

118.

1.     How many plots will be created by this command?

fig, axes = plt.subplots(nrows=1, ncols=2)

a)

3

b)

1

c)

4

d)

2

119.

1.     How many lines will be created by the following command?

fig, ax = plt.subplots()

ax.plot(x, x**2, 'b.-') # blue line with dots

ax.plot(x, x**3, 'y--') # green dashed line

a)

3

b)

5

c)

4

d)

2

120.

1.     How many plots will be created by this command?

fig, ax = plt.subplots(2, 3)

fig.tight_layout()

a)

3

b)

8

c)

2

d)

6