Font size
WorksheetsPython
Total questions: 35
Worksheet time: 18mins
1,2,3,4
Which of the following statements create a dictionary?
a) d = {}
b) d = {“john”:40, “peter”:45}
c) d = {40:”john”, 45:”peter”}
d) All of the mentioned
How many times will this code loop?
50
90
0
4
Suppose list1 is [2445,133,12454,123], what is max(list1)?
a) 2445
b) 133
c) 12454
d) 123
If a=(1,2,3,4), a[1:-1] is _________
a) Error, tuple slicing doesn’t exist
b) [2,3]
c) (2,3,4)
d) (2,3)
To add a new element to a list we use which Python command?
a) list1.addEnd(5)
b) list1.addLast(5)
c) list1.append(5)
d) list1.add(5)
Suppose listExample is [‘h’,’e’,’l’,’l’,’o’], what is len(listExample)?
a) 5
b) 4
c) None
d) Error
Which of these will allow me to print all numbers from 0 to 4 ?
//0,1,2,3,4
for x in range(4):
print(x)
for x in range(0,4):
print(x)
for x in range(1,5):
print(x)
for x in range(5):
print(y)
What are the syntax errors in this code?
:
Not indented
Both options
What will be the output of the following Python code snippet?
d = {"john":40, "peter":45}
d["john"]
a) 40
b) 45
c) “john”
d) “peter”
Dalam memprogram python perlu adanya pendukung tools dalam mengelolah data yang sangat besar dan juga tim, maka dari itu berikut ini manakah yang bukan dari tim system owner turbin.
Andi Kusuma Hadi
Febri Wahyu D
Tofan Nugroho
Agus Sulistiyono
It displays an output
What is the keyword needed to repeat code (iterate) in Python?
for
if
input
Which are list functions?
append()
index()
items()
len()
What will be the output of the following Python code?
>>>str1="helloworld"
>>>str1[::-1]
a) dlrowolleh
b) hello
c) world
d) helloworld
Apakah module package dalam mengembangkan Bot telegram, kecuali
pyTelegramBotAPI
python-telegram-bot
connect-telegram-bot
pyTelegramBot
#How many hallos will be printed?
5
None
4
6
Dalam menampilkan data python ke visualisasi dashboard, terdapat banyak pilihan dari melakukan dengan koneksi java script ataupun open source dashboard, berikut ini manakah yang merupakan open source dashboard untuk menampilkan data python.
Grafana
Freeboard
Dashbuilder
Wordpress
Which symbols are used in conditional logic?
<
>=
=
==
=<
Which of the following is used to define a block of code in Python language?
a) Indentation
b) Key
c) Brackets
d) All of the mentioned
To move the turtle to a specific position on the drawing canvas you need to use which of the following commands?
set_pos( )
setpos( ):
setpos
setposition( )
What does the following program display?
1,2,3,4
1,2,3,4,5
counter,counter,counter,counter,counter
0,1,2,3,4,5
IQR adalah metode untuk menentukan Upper dan Lower suatu data analisis, untuk mempermudah dalam pengambilan data yang banyak maka diperlukan sintak iloc, iloc itu sendiri merupakan import dari module apa,
Pyscopg2
Seaborn
Pandas
Sqlalchemy
Selain menggunakan anaconda untuk menampilkan jupyter notebook, bisa menggunakan langsung dengan CMD (Command Prompt), seperti apa sintaksnya,
Open Jupyter
Open Jupyter Notebook
Jupyter Notebook
Jupyter
What will be the output of the following Python code?
>>> str1 = 'hello'
>>> str2 = ','
>>> str3 = 'world'
>>> str1[-1:]
a) olleh
b) hello
c) h
d) o
In order to move the turtle 120 forward without drawing on the screen, which order is correct?
turtle.forward(120)
turtle.penup()
turtle.pendown()
turtle.pendown()
turtle.forward(120)
turtle.penup()
turtle.penup()
turtle.forward(120)
turtle.pendown()
Salah satu tools untuk mempermudah pembacaan aplikasi python
Jupyter notebook
Anaconda
Sublime Text
Idle Python
Which were the objectives for Day 2 Python?
Lists and dictionaries
Classes
Iteration
Custom functions
Indexing
Which of these commands would create a turtle named Alice?
Alice = turtle.pen()
Alice = Turtle.pen()
Alice = Turtle.turtle()
Alice = turtle.Turtle()
How many times does the following program print the word ‘computer’:
word= "computer"
for num in range(2,8):
print(word)
5
6
1
0
What do you put at the end of a turtle program?
import turtle
wn.mainloop()
hunter = turtle.Turtle()
wn = turtle.Screen()
Which of the following functions is a built-in function in python?
a) factorial()
b) print()
c) seed()
d) sqrt()
