0% found this document useful (0 votes)
3 views

10THWorksheet(ProgrammingFundamentals)_edited

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

10THWorksheet(ProgrammingFundamentals)_edited

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

GIMNASIO FONTANA

DIGITAL CITIZENSHIP WORKSHOP 10th GRADE


WARMING UP TERM III
TEACHER: MAURICIO LÓPEZ NÚÑEZ

NAME: __________________________________ DATE: ____________

All the exercises have to be done in Code HS, share the links through Phidias in a message.
1. The Print function allows you to visualize data and information on screen, the syntax that you
have to use is the describe below:

Clue: Inside the parenthesis you need to specify what is the information that you want to print,
consider that depending on data type, the syntax change:

Numbers or operations:

Comparison and logical operators

Letters or characters

Exercise #1
Create a program where you are going to print personal data, considering the next
information:
Name
Last Name
Nickname
ID number:
Telephone Number:
Age:
Look at the example below about the way the exercise result must be:
2. The arithmetic operators allow you to perform calculations between quantities declared.
print("This program will ask
You have to keep in mind the basic operators contained in the next table

Addition
Name
you for your personal Syntax Operation
𝐴+𝐵

Subtraction
information and create a chart 𝐴−𝐵

Multiplication using it.") 𝐴𝑥𝐵

Division name = input("Please give 𝐴me ⁄𝐵

Empowerment your name, only your name: 𝐴 ")


𝐵

Integer Division last_name = input("Please 𝐴⁄


𝐵
give me you last name: ")
There is no decimals in the
result
Module nickname = input("Please It is the remainder of the
division
give me your nickname: ")
Exercise #2
ID_Number = input("Please
Create a program where you are going to create 14 (2 for every operator) operations,
enter
considering the operation to beyour idthenumber:
performed and ")concatenated with Strings
result. Print the result
where you can read what is the operation to be solved. The image below illustrates the result
process. Cel_Number = input("Please
give me your cellphone
number: ")
Age = input("Please give me
your age: ")
print("Name: " + ("- ")*6 +
name)
print("Last Name: " + ("- ")*4 +
3. Relational operators are also called comparison operators.

It performs a comparison between two values. It returns a Boolean True or False depending upon
the result of the comparison.

Python has the following six relational operators.

Assume variable x holds 10 and variable y holds 5

Operator Description Example


It returns True if the left
x>y
> (Greater than) operand is greater than the
result is True
right
It returns True if the left x<y
< (Less than)
operand is less than the right result is False
It returns True if both operands x == y
== (Equal to)
are equal result is False
It returns True if both operands x != y
!= (Not equal to)
are equal result is True
It returns True if the left
x >= y
>= (Greater than or equal to) operand is greater than or equal
result is True
to the right
It returns True if the left
x <= y
<= (Less than or equal to) operand is less than or equal to
result is False
the right

Example
Exercise # 3
Create a program that reads 2 numbers by keyboard and determines the following aspects (it is
enough to display True or False):

If the two numbers are equal


If the two numbers are different
If the first is greater than the second
If the second is greater than or equal to the first
4. INPUT Function:
In Python, we use the input() function to take input from the user. Whatever you enter as input, the
input function converts it into a string. If you enter an integer value still input() function converts it
into a string.
Example:

Exercise #4

Create a program that asks the user for various information:


Name, Age, Phone, City, and then print them in a specific format, as seen in the following example.

You might also like