Search Header Logo
제목 없는 프레젠테이션

제목 없는 프레젠테이션

Assessment

Presentation

Computers

University

Practice Problem

Hard

Created by

Uijin Jang

FREE Resource

43 Slides • 28 Questions

1

media

2

media

3

Open Ended

How do you think string formatting and data type conversion are useful when writing a program?

4

Multiple Choice

Which of the following is an important reason to learn the basics of programming?

1

To understand how computers work and solve problems

2

To memorize all programming languages

3

To avoid using technology

4

To only play computer games

5

media

6

Multiple Choice

Which format specifier would you use to print a floating-point number using the % operator in Python?

1

%d

2

%s

3

%f

4

%c

7

media

8

Multiple Choice

When using the % operator for string formatting in Python, how do you include multiple values in the string?

1

By separating values with commas inside the string

2

By enclosing the values in a tuple after the % operator

3

By using curly braces for each value

4

By writing each value on a new line

9

media

10

Open Ended

Explain the difference between printing '100' and printing '%d' % 100 in Python. What does each output represent?

11

media

12

Fill in the Blanks

Type answer...

13

media

14

Multiple Choice

Which of the following statements about the format() method in Python is correct?

1

It only works with strings, not numbers.

2

It allows you to specify the position of arguments using indices.

3

It cannot be used to format multiple values at once.

4

It replaces all curly braces with the same value.

15

media

16

Multiple Select

Select all the correct ways to format numbers with spaces or commas using the format() method in Python.

1

'{:3d}'.format(5)

2

'{:,}'.format(1234567)

3

'{:f}'.format(3.14)

4

'{:d,}'.format(1000)

17

media

18

Multiple Choice

Which method allows you to control the number of decimal places shown when printing a floating-point number in Python?

1

format() method

2

split() method

3

replace() method

4

join() method

19

media

20

media

21

Multiple Choice

What is the main difference between using commas in the print() function and using f-strings for output formatting in Python?

1

Commas add spaces between values, while f-strings allow for direct variable insertion without spaces.

2

Commas remove spaces between values, while f-strings add extra spaces.

3

Commas only work with strings, while f-strings only work with numbers.

4

Commas and f-strings produce identical output.

22

media

23

Open Ended

Explain how you can specify the width and alignment of output fields when printing variables in Python. Provide an example.

24

media

25

Multiple Select

Which of the following are valid escape characters in Python's print() function?

1

\n

2

\t

3

\b

4

\'

26

media

27

Open Ended

Describe the three main types of operators in Python and give an example of each.

28

Fill in the Blanks

Type answer...

29

media

30

Fill in the Blanks

Type answer...

31

Multiple Choice

Which operator would you use in Python to calculate the remainder when dividing two numbers?

1

+

2

-

3

%

4

**

32

media

33

Open Ended

Write a program that calculates the ratio of male to female applicants given their respective counts. What Python operators would you use and why?

34

media

35

Open Ended

Explain the difference between the '/' and '//' operators in Python. Provide an example for each.

36

media

37

media

38

Multiple Select

Which of the following statements about the '%' operator in Python are correct?

1

It returns the quotient of division.

2

It returns the remainder of division.

3

It can be used to check if a number is even or odd.

4

It always returns a float.

39

media

40

Open Ended

Given a total amount of 5000 won and a product price of 2600 won, how many 500-won and 100-won coins will be returned as change? Show your calculation process.

41

media

42

Multiple Choice

Which operator in Python is used for exponentiation and what is its associativity?

1

** operator, right-to-left

2

* operator, left-to-right

3

^ operator, left-to-right

4

** operator, left-to-right

43

media

44

Multiple Choice

Arrange the following operators in order of increasing precedence: +, *, //, %.

1

+, *, //, %

2

+, //, %, *

3

+, %, //, *

4

+, *, %, //

45

media

46

Open Ended

Explain how you can convert a string representing a number into an integer or a float in Python. Give an example.

47

media

48

Open Ended

Write a program that calculates the total sales for a coffee shop given the number of items sold for each menu item. The menu prices are: Americano = 2,000, Cafe Latte = 3,000, Green Tea = 2,500.

49

media

50

Multiple Choice

BMI is calculated as weight (kg) divided by height (m) squared. If a person weighs 65 kg and is 175 cm tall, what is their BMI?

1

21.22

2

23.45

3

19.87

4

25.10

51

media

52

Fill in the Blanks

Type answer...

53

media

54

media

55

media

56

media

57

media

58

media

59

media

60

media

61

media

62

media

63

media

64

media

65

media

66

media

67

media

68

media

69

media

70

Open Ended

Reflecting on today's session about programming basics, what is one question you still have or a concept you would like to explore further?

71

Multiple Choice

Which topic from today's lesson did you find most interesting or would like to learn more about?

1

String formatting

2

print() function

3

Operators

4

Data type conversion

media

Show answer

Auto Play

Slide 1 / 71

SLIDE