Python programming 1

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/54

encourage image

There's no tags or description

Looks like no tags are added yet.

55 Terms

1
New cards

what is an input in python?

values which get sent from the user into the computer

2
New cards

what is a variable in python?

a storage container for data that allows you to save information and manipulate it

3
New cards

what is output in python?

the values that get sent from the computer to the user

4
New cards

what is a string?

any combination of keyboard characters surrounded by speech marks

5
New cards

integer

any whole number- the computer can do maths with this data

6
New cards

real

any decimal or fraction number

7
New cards

boolean

when something is true or false

8
New cards

what does python do when we input a number into our program using input()

python automatically sets the variable as a string

9
New cards

what is a decision in python?

deciding what to do depending on certain conditions

10
New cards

what symbols do we use to compare data in python?

<, ==, >, >=, <=, !=

11
New cards

what does the word iterate mean?

to loop or repeat

12
New cards

when do we use elif in python?

13
New cards

when do we need quotes?

When we compare strings

14
New cards

when do we use == in python

when we want to see if something is mathematically equal to another

15
New cards

what do If-else statements to do?

allows programmes to make decisions based on certain conditions

16
New cards

what does selection use?

If-else statements

17
New cards

when do we use selection in python?

when we want the computer to make a decision based on our input

18
New cards

what is an if statement?

a statement which allows a program to take different pathways depending on particular decisions

19
New cards

what will be the output of (“3 +4”)

3+4

20
New cards

what are data types in python

21
New cards

floar, integer, boolean, and strings are examples of what?

data types

22
New cards

what will be the output from the following code: print (3 ×4)

12

23
New cards

what type of data type is : true

boolean

24
New cards

what 3 things does a variable have ?

name, type value

25
New cards

what type of data type is this: 6

integer

26
New cards

what type of data type is this: true

boolean

27
New cards

what type of data type is this : “sarah”

string

28
New cards

what is char in python?

a single visual unit which can be a letter, symbol, or a blank space

29
New cards

what are the different types of data types

integers, float, booleans, string,

30
New cards

how do we comment in python

by using a hashtag

31
New cards

what is casting

converting a variable from one data type to another

32
New cards

what is a data type?

the type of data being used by the program

33
New cards

what is iteration

another name for a loop

34
New cards

if i asked you to clap your hands 5 times, what type of loop is this?

a for loop

35
New cards

If i asked someone to clap their hands until i said stop, what kind of loop is this?

while loop

36
New cards

what is a for loop?

a counting loop- we know how many times the loop will run

37
New cards

what is a while loop

a condition controlled loop - it will run until a certain condition is met

38
New cards

what does a while loop do?

It repeats a section of code whilst a certain condition is true

39
New cards

how do we make all the letters go to lower case?

.lower()

40
New cards

what does the word iteration mean?

loop or repeat

41
New cards

what are ‘while loops’

condition controlled

42
New cards

what are for loops?

count controlled

43
New cards

for the code: for x in rage (m,n,o):, what does m represent ?

the number that the loop will begin counting from

44
New cards

for the code: for x in rage (m,n,o):, what does n represent ?

the number that the loop will count up to

45
New cards
print('What is your age?')
age = int(input())
print('Total books read in 2024:')
books = int(input())

if age > 10 and books > 8:
    print("That's impressive!")
elif age > 10 and books <= 8:
    print("You should read more")
else:
    print("I hope you like reading")

If you entered 10 for the first question, and 10 for the second question, what will be the output

I hope you like reading

46
New cards

for the code: for x in rage (m,n,o):, why would the nuber than n represent not show?

because it starts at m, and ends at n but not including n

47
New cards

hat does ‘elif’ mean?What

else if

48
New cards

what does the logical expression ‘or’ mean?

one or both logical expressions must be true

49
New cards

what does the logical expression ‘and’ mean?

both logical expressions must be true

50
New cards

what are floats in python?

positive or negative numbers that contains a decimal point

51
New cards

for the code: for x in rage (m,n,o):, what does o represent ?

the steps that the loop is counting in

52
New cards

what is the main purpose of using condition statements like ‘if’ in python programming?

so that there are different pathways to take depending on if something is true or false

53
New cards

what does a string in python do?

represents words or sentences

54
New cards

what is the main purpose of the print() function in python?

to display output on the screen

55
New cards

What happens if none of the conditions are in an ‘if’ following an ‘elif’ statement are true, and there is no else statement?

the program will continue the next line of code after the conditional block