Search Header Logo

Quiz String, Text Files, Exception

Authored by Syifa Nurhayati

Computers

University

Used 1+ times

Quiz String, Text Files, Exception
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

x = "apple"

Mana saja pilihan yang akan mencetak huruf p?

print(x[2])

print(x[1])

print(x[-1])

print(x[-2])

2.

FILL IN THE BLANK QUESTION

1 min • 1 pt

Media Image


Angka terakhir yang dicetak program tersebut adalah...

3.

FILL IN THE BLANK QUESTION

1 min • 1 pt

a = "one"

b = "two"

print((a+b+a)*1) akan menghasilkan output...

4.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

print("{2}-{0}-{1}".format('September', 21, 2022))

21-September-2022

September-21-2022

2022-September-21

Syntax Error

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

Agar tercetak output seperti pada gambar, kode yang tepat adalah ...

print(f"{judul:.>50d}{halaman:.<5d}")

print(f"{judul:.<50s}{halaman:.>5d}")

print(f"{judul:.<50d}{halaman:.>5f}")

print(f"{judul:.>50s}{halaman:.<5d}")

6.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Method yang akan mengembalikan setiap baris menjadi elemen dalam list adalah ...

read()

open()

readline()

readlines()

7.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Media Image

Untuk membaca kata "Semangat" apa yang harus dilakukan?

file = open('pesan.txt', "r")

file.read(8)

file.read(7)

file.read(0,7)

file.read([0:7])

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?

Discover more resources for Computers