You are on page 1of 3

1. Aside from following syntax rules, what else makes a variable name effective?

First,the variable must have a proper self documenting name that is written in a good
looking case either pot_hole_case or camelCase style and use it consistently throughout
the code.

2. Which of the following variable names would give a syntax error (and why), and which
would be considered poor style (and why)?
○ y (poor style not explaining the use of the variable)
○ 2cool (error a variable can’t start with a number)
○ Thehighestscoreever (poor style as no underscores or capitalization for the first
letter of each word is used)
○ Student_Average(not following CamelCase properly an underscore is used)
○ term&sumative(error can’t have a & operator in a variable name)

3. Define the following terms:

Compiler :It is a program that turns code written in compiled languages like (java or
c++) into machine code and after all the code is compiled it can be executed.It also
optimizes and variable checks the entire code to be successfully compiled.

Interpreter:It is a program that turns code written in a high programming language into
machine code in order to be executed .This is done one line at a time and errors might
appear during runtime ,not before compared to the compiler.

Algorithm:It is a specified number of exact and detailed orders(functions) to accomplish


a certain task in computer science
ASCII:it stands for the( American Standard Code for Information Interchange).It is the
most common character encoding format used in computers and for data
processing,where each letter has a code to represent it.

Where ASCII art :it is using ASCII characters(letters,commas,exc.) to make shapes


forming simple art or even pictures

4. So far we have seen three data types in Python. List them, and give an example value
that each might store.

int(integer):2

float(real numbers):2.9

str(strings):’’g”

5.Use the print command and make the first character of your name in ASCII art style.

print("""
######
#
#
#
#
# #
####
""")

You might also like