Search Header Logo

Pytania z Pythona

Authored by Karol Filipkowski

Other

1st Grade

Used 3+ times

Pytania z Pythona
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

31 questions

Show all answers

1.

MULTIPLE SELECT QUESTION

5 mins • 1 pt

Napisz funkcję która obliczy x*y gdy x>0 i y>0:

def multiply(x, y):

if x > 0 and y > 0:

return x * y

else: return "Both numbers must be greater than 0"

if x > 0 and y > 0:

return x * y

else: return "Both numbers must be greater than 0"

2.

MULTIPLE CHOICE QUESTION

5 mins • 1 pt

Co zostanie wyprowadzone na ekran po uruchomieniu skryptu: lista = [1, 2, 3, 4, "informatyka"] lista[3] = 'python'

Lista zmieni się na [1, 2, 3, 'python', 'informatyka'].

x

xx

x

3.

MULTIPLE SELECT QUESTION

5 mins • 1 pt

Które metody można wywołać na danych A, B typu set:

A.issubsets(B)

A.del(B)

A.union(B)

A.intersection(B)

4.

MULTIPLE CHOICE QUESTION

5 mins • 1 pt

W jakim celu zwykle stosuje się __add__?:

add jest stosowane do przeciążenia operatora + w klasach, pozwalając na definiowanie niestandardowego zachowania dla operatora dodawania.

x

x

x

5.

MULTIPLE SELECT QUESTION

5 mins • 1 pt

W pętli for wyświetl klucze słownika: slownik = {"Janusz": 1980, "Grażyna": 1985}

slownik = {"Janusz": 1980, "Grażyna": 1985}

for key in slownik:

print(key)

6.

MULTIPLE SELECT QUESTION

5 mins • 1 pt

Napisz kod który wyświetli 30 i UwB z słownika student: student = {"wiek": [20, 30, 40], "uczelnia": {"U1": "UwB", "U2": "PB", "U3": "PB"}}

student = {"wiek": [20, 30, 40], "uczelnia": {"U1": "UwB", "U2": "PB", "U3": "PB"}}

print(student["wiek"][1])

print(student["uczelnia"]["U1"])

7.

MULTIPLE SELECT QUESTION

5 mins • 1 pt

Wymień funkcje umożliwiające:

podgląd zawartości folderu= os.listdir()

utworzenie nowego folderu=os.mkdir()

zmianę dolderu=os.chdir()

podgląd ścieżki roboczej=os.getcwd()

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?