By: Aboubakr Soultan

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 31

Exam

By: Aboubakr Soultan


1 print(Hello world!)

Which command
2 print "Hello world!"
will display the
text 'Hello
world!' on the 3 print("Hello world!")
screen?

4 print = "Hello world!"


Which command will
correctly ask the user for
their age?

1. age = input("How old are you?")


2. age = input(How old are you?)
3. input("How old are you?") = age
4. How old are you = input()
What is the 8 "5" + "3"
result of this
command?
print ("5" + "3")
"8" 53
Which function will convert a number to a
string?

int() str() ord() chr()


Which function will convert a string
containing only digits into a number?

int() str() ord() chr()


Which decision statement will be triggered if
the variable x is less than 20?

• if x > 20:
• if x <> 20:
• if x == 20:
• if x < 20:
x = "Hello"

Which of these x != "Hello"


tests whether
the variable x is
the same as x == "Hello"
'Hello'?

x <> "Hello"
A piece of data that can change

A piece of data you cannot change


What is a
variable?
A coding technique

A special file
What does input do?

It allows users to It converts data It allows a user to It allows users to


change the program types solve a task enter data
Integer

Float
what data
type is 3.95? String

Character
What would the output of this code
be if the user entered the value 70?

1. Pass
2. Fail
3. Merit
4. Distinction
A whole number

Which best
A number that can have a decimal
describes the
types of data a
string variable Either true or false
can hold?

A set of letters and/ or numbers


What would the outcome of this
program be?

• 22
• 50
• Nothing, it won't run due to errors in the code
• 38
Which operator means not equal to

== != >= <=
Integer

What sort of
Data Type is
Float String
the following
value: 23.45?

Boolean
Closes the program

What does an Makes a decision

IF statement
do? Makes a copy of the code

Makes a coffee
Theories

Strings
What are
these? ==, !=,
<, >, <=, >= Boolean Operators

Comparison Operators
Input

What function If
do you use to
display output
on the screen? Print

Show
The data type for text is:

Int Float Str Bool


The data type for whole numbers is:

Int Str Bool Float


The data type for decimal values is:

Int Str Bool Float


1stChoice

Which of First Choice


these variable
names is firstChoice
valid?
First+Choice
Which one of these is the symbol for DIVIDE

/ * ** \
Which one of these is the symbol for
MULTIPLY?

X * ** ^
I want to force • age = int("What is your age?")
• int = age(input("What is your age?")
the user to input
• age = ("What is your age?)
a number for an • age = input("What is your age?")
age. Which
answer is correct?
Which of the following would you use to ask
the user for their name and store it?

none of
input print int
these
Integer

Boolean
What do we
call decimals
in Python String

Float
What symbols do we use for not equals?

>= "=!" != !!=


A sequence of instructions
to solve a problem

The finished code with


comments
What is an
algorithm? Its the same as pseudo
code

A string that will help


answer a problem
How would I print a variable the
variable age = 11?
• print(11)
• print(age)
• Print(age)
• print(age = 11)

You might also like