Search Header Logo
Python OOP Lesson 1 Part 2

Python OOP Lesson 1 Part 2

Assessment

Presentation

Computers

University

Hard

Created by

Karen Ahmed

Used 14+ times

FREE Resource

4 Slides • 5 Questions

1

Object-Oriented Programming Lesson 1

Procedural Python

2

​Python Basics

  • print() outputs text to the screen.

  • ​input() accepts user input.

  • ​Variables need to be assigned a value before they can be used.

  • ​Selection is made using if-else or if-elif-else statement blocks.

  • ​Python uses indentation for selection, iteration and functions.

  • ​Functions are defined with the keyword def.

  • ​Strings need to be surrounded with quotes

media

3

web page not embeddable

QuickCalculator2 - Replit

You can open this webpage in a new tab.

4

Multiple Choice

Which function outputs text to the terminal?

1

output()

2

write()

3

print()

4

type()

5

Multiple Choice

What is the Python syntax for creating a variable and assigning the number 10 to it?

1

variable_name == 10

2

variable_name = 10

3

def variable_name = 10

4

new variable_name = 10

6

Multiple Choice

Question image

What is the output of this code?

1

cool_number

2

210

3

42

7

Multiple Choice

Which character is used for a comment in Python?

1

#

2

*

3

"

4

/

8

Multiple Choice

Question image

What happens if we run this code in Python?

1

"message" is printed

2

"What a cool message!" is printed

3

Python throws a syntax error

9

web page not embeddable

GuessTheNumberGame - Replit

You can open this webpage in a new tab.

Object-Oriented Programming Lesson 1

Procedural Python

Show answer

Auto Play

Slide 1 / 9

SLIDE