Python Function Quiz

Python Function Quiz

1st Grade

26 Qs

quiz-placeholder

Similar activities

INFORMATIKA_clas7latihan

INFORMATIKA_clas7latihan

1st Grade

30 Qs

computer science

computer science

KG - Professional Development

22 Qs

Year 7 Python - MCA

Year 7 Python - MCA

1st Grade

22 Qs

Sistem Bilangan

Sistem Bilangan

1st Grade

21 Qs

KS3 Networking Quiz

KS3 Networking Quiz

1st - 3rd Grade

24 Qs

Identifying Digital Devices

Identifying Digital Devices

KG - 2nd Grade

21 Qs

Computer Quiz 2.1 Reviewer

Computer Quiz 2.1 Reviewer

1st Grade

25 Qs

FE Big Quizz

FE Big Quizz

KG - 3rd Grade

30 Qs

Python Function Quiz

Python Function Quiz

Assessment

Quiz

Computers

1st Grade

Medium

Created by

Adham Elmuntser

Used 1+ times

FREE Resource

26 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In the given get_name function, which method is used to remove leading and trailing spaces?

trim()

strip()

clean()

remove()

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will get_password function print if the entered password is '12345'?

Password is valid.

Please enter a valid number for your age.

Password must be at least 6 characters long.

Invalid input! Please enter a number.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In the get_age function, what is the purpose of the try block?

To convert the age to a float.

To handle cases where input is not an integer.

To compare the age with 120.

To check the length of the input.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which function is used to check if a file path exists in get_file_path?

os.path.isfile()

os.path.ispath()

os.path.exists()

os.path.check()

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In the get_email function, which characters are checked to validate the email?

@ and #

@ and .

. and !

# and .

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will the get_credit_card_number function output if the input is '123456789012345'?

Invalid credit card number. It should be 16 digits.

Credit card number is valid.

Please enter a valid number for your age.

Name cannot be empty!

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following functions is used to change the input to lowercase in the get_confirmation function?

lower()

to_lower()

downcase()

lowercase()

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?