CS105 final
In CSS, which wording is used to add the background color to an element?
"background-color"
How do you assign a class name "SantaClaus" to an image in CSS?
.SantaClaus {image = SantaClaus}
In CSS, how can you select an element with the class "example"?
.example
In turtle, if you want to move your turtle to a specific point on the axes what command do you give?
.goto()
How can you select an element with the class "highlight" in CSS?
.highlight
1 pixel (px) is how much area of an inch?
1/96th of an inch
Which of the following is true? 1px = 1pt 1px < 1pt 1px > 1pt 1px = 100pt
1px < 1pt
1) What does the following Python code Output? print (8 // 3)
2
If value = 20, then value % 3 would be
2
How many levels of headings are in HTML?
6
What is the first line of code in an HTML file?
<!DOCTYPE html>
HTML tags use angle brackets to identify the tag. It starts as <html> but how does one close an html tag?
</html>
Which HTML tag is used to create a hyperlink?
<a>
What is the HTML code to bold a text?
<b>, </b>
In HTML and CSS, how do you make a text bold?
<b>text</b>
Which header has the smallest font size?
<h4>
In HTML, which syntax denotes a horizontal line on the webpage similar to the one shown above?
<hr>
In HTML how do you italicize a text?
<i>
What is the correct HTML for making a text input field?
<input type="text">
How to change the text color on HTML using CSS?
<li style= "color: color;">item </li>
Which HTML tag is used to link an external CSS stylesheet to an HTML document?
<link>
Which HTML tag is used to create an ordered list?
<ol>
Which of the following tags is used to define a header cell in HTML?
<th>
Which one represents a table header?
<theader>
Which Operator is used to compare variables that are equal to each other?
==
Which of the following statements is completely true about a while loop and a for loop in Python?
A for loop runs for a set amount of times, and a while loop can run infinitely. Any while loop can be recreated with a for loop
:active in CSS
A link the moment it is clicked
Definition of functions is?
Allow us to GROUP code together for easy re-use.
What is the difference between an ID and a class in HTML/CSS?
An ID can only be applied once while a class can be applied multiple times
What does CSS stand for?
Cascading Style Sheets
What is the correct way to create an object in Java?
ClassName objectName = new ClassName();
What website can be used to find colors to use in CSS?
Colorhunt.co
What is the purpose of the "if" statement in Python?
Conditional execution
In HTML what does the input <hr> do?
Creates a thematic break
In HTML, what does the <div> element stand for?
Division container
What is the tree structure of a webpage called?
Document Object Model
What is the purpose of the HTML <img> tag?
Embed an image
The first line of a function definition is known as the _____?
Header
What is HTML?
Hyper Text Markup Language
How do inline CSS and style tags relate to one another?
Inline overrides internal style tag
Which of the following is NOT an element of a while loop in Python?
Instructor
What is the purpose of the "break" statement in a Java switch statement?
It ends the switch statement.
What is the purpose of the static keyword in Java?
It indicates that a method can be called without creating an instance of the class.
What is the purpose of the __init__ method in Python classes, and how is it used?
It is used for initialization of class variables and is automatically called when an object is created.
Which does not belong to Java Script?
Letters
Which statement accurately describes the relationship between links and anchors in HTML?
Links connect one webpage to another, while anchors create a hyperlink within the same webpage
What does LCV stand for?
Loop Control Variable
What is the difference between a function and a method in Python?
Methods are functions that are defined within a class, while functions are standalone.
In Python, what is the vast library of prewritten code that you can use?
Modules
All of these are variables in Java EXCEPT...
Number
What are the five data types?
Number, String, Boolean, Date, Currency
In CSS, if I want to change the transparency of a photo which property would I use?
Opacity
In Python what is the command to make a code "print" something?
Print("_______")
In Python there is a difference between "1" and 1, what does "1" stand for?
String
Which of the following represents textual data
String
Which of the following is a data type in Python?
Strings
Which of the following is the correct syntax to output "Hello World" in Java?
System.out.println("Hello World");
1. What is a primer in Python
The background color picker
The code snippet if __name__ == "__main__": in Python is used for:
To check if the script is run as the main program
In JavaScript, what is the main purpose of the 'alert' function?
To display a pop-up dialog box with a specified message to the user
What is the range() function used for?
To get a range of numbers
Sum of the numbers: 15
[4, 8]
In HTML, which input command accurately creates the output of a line break?
a. <br>
What is the difference between a while loop and a for loop in Python?
a. While loops run infinitely while for loops run a set amount of times
What must be typed in order to take an integer input in Python?
a. int(input())
Given the array, var a = [5, 10, 15, 20], which of the following will result in the value 15?
a[2]
What are the two kinds of tags in html?
block elements and inline elements
Which one of the following is a selector in CSS?
class, ID, type selectors
In a web browser's developer console, which of the following JavaScript functions is used to display a message in the console?
console.log()
If statements...
control if a block of code should be executed or not
Which method in Python is used to count the occurrences of a specific element in a list?
count()
Which function of "computer" is properly defined in python?
def computer():
Which of the following CSS selectors selects all <p> elements that are children of a <div> element?
div > p
In order to give responses in python for when the "if" statement is wrong you use what input?
elif
What is the correct priority of style editing, from most priority to least?
external css, inline, internal html
Which of the following is used to declare a constant in Java?
final
What type of variable is a number with a decimal?
float
Which of the following is not a valid Python data type?
float
Which of the following precedes the name of a class in CSS code?
full stop (.)
What symbol is used for comments in Python code?
hash symbol #
How is a code block indicated in Python?
indentation
Which of the following Python functions is used to find the index of a specific element in a list?
index()
What is true about an anchor tag in HTML?
it must be placed inside a block element
In Python, what is the function used to find the length of a list?
len()
Which of the following is used to open a file in Python for reading?
open("file.txt", "r")
In Python, which input accurately creates the output, "Hello Students"?
print("Hello Students")
To print to the console "I ran 2 miles today" the user would write
print("I ran 2 miles today)
What is python primarily known as?
programing language
len()
returns the length of a list or string
A css declaration consists of...
surrounded by curly braces, a colon, a semi colon
What is the purpose of the '<p>' tag in HTML?
to create a paragraph
What is the purpose of 'print()' in Python? .
to display text on screen
Which is the correct way to use addition in python?
totalValue = 1 + 1
In Python, What command is used to determine the data type of an object?
type()
Which of the following is a valid declaration of a variable in Python?
x = 10