Commands Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

print (“Welcome”)

A

displays the words “Welcome” to the screen

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

input (“Enter your name”)

A

asks the user to enter their name

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

int(input(“Enter a whole number”))

A

displays “Enter a whole number” and changes the data type of the input to an integer

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

number=int(input(“Enter a whole number”))

A

displays “Enter a whole number” and changes the data type of the input to an integer and saves the answer as variable number

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

If colour==blue:print(“blue)

A

checks if the colour is blue and prints blue if so

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

If num>5:print(5)

A

checks if number is larger than 5 and prints 5 if so

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

capital=input(“What is the capital of Bangladesh”)

A

displays “What is the capital of Bangladesh” and gets user to answer

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

if capital == “Dhaka”:
print(“Correct”)
else:
print(“wrong”)

A

If user inputs “Dhaka” then displays “Correct” otherwise displays “wrong)

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