Final Exams: Chapter 1 and 2 Flashcards

1
Q

What is a variable?

A

It store data to a name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is an integer (int)

A

Interpret the users input as a number

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a while loop

A

A while loop continues to run the code until and input changes (ie no)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does == mean

A

Equal to

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does != mean

A

Not Equal to

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does “from random import randint” mean

A

It tells the program to import the function randint

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What an Assignment

A

It set a name to a value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a =

A

Assignment opperator

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a print( )

A

It displays a message screen

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a input( )

A

Gets and returns a users value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a int( )

A

Converts characters into numbers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is ranint( )

A

produces a random number

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a string

A

A series of characters

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is a substring

A

It is a sequence of characters contained with a another string

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

In the statement “print(msg.upper)))” what does the dot mean

A

The dot means “call the method on the specified variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

In the statement “print(msg.upper)))” what does upper() mean

A

The upper means is a string method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What does text.endswith(“.jpg”) mean

A

Return the value True if the string has the given substring at the end.

18
Q

What does text.upper() mean

A

Return a copy of the string converted to uppercase.

19
Q

What does text.lower(): mean

A

Return a copy of the string converted to lowercase.

20
Q

text.replace(“tomorrow”, “Tuesday”): mean

A

Return a copy of the string with all occurrences of one substring replaced by another.

21
Q

What does “text.strip():” mean

A

Return a copy of the string with the leading and trailing whitespace removed.

22
Q

What does text.find(“python”): mean

A

Return the first index value when the given substring is found.

23
Q

What does text.startswith(“” mean

A

Return a copy of the string with all occurrences of one substring replaced by another.

24
Q

What does the find( ) method mean

A

finds the starting position of a substring

25
Q

What is a float

A

It converts whole number into a decimal number

26
Q

what does import urllib.request mean

A

use code stored in the “urllib.request” library.

27
Q

What are strings?

A

Sequences of individual characters.

28
Q

Individual string characters are referenced by?

A

Index

29
Q

Index values are offsets that start from?

A

0 (Zero)

30
Q

Methods provide variables with?

A

built-in functionality

31
Q

Programming libraries provide a collection of

A

related pre-built code and functions.

32
Q

Number is a

A

Data Type

33
Q

String is

A

Data Type

34
Q

s[4]

A

access the 5th character of the variable “s”, which is a string

35
Q

s[6:12]

A

Searches from the 7th character of the variable to the 11 variable
access a sub-string within the string “s” (up to, but not including)

36
Q

s.find() method for

A

searching strings

37
Q

s.upper() method for

A

converting strings to UPPERCASE

38
Q

float() converts strings to

A

Decimal point numbers known as “floats”

39
Q

What is the +

A

addition operator

40
Q

What is >

A

greater than operator

41
Q

urllib.request library for talking

A

to the web

42
Q

time library for working with

A

date/time