Intro to Computing

¡Supera tus tareas y exámenes ahora con Quizwiz!

What operator would you use to return true if two variables are different?

!=

What symbol would be used to make a comparison of two values not equal to each other?

!=

When creating the first line of programming, there is one line everyone programs, and that is?

"Hello World"

What would be a combination of quotes that would not be allowed?

"hello'

What character starts a comment in Python?

#

What string definition would result in an error?

'It's 10am'

What would be the output of the code: def isEven(num): return num % 2 == 0 if isEven(3): print("3 is not even")

3 is not even

What expression evaluates to 2?

5%3

What would be the output of the code: import random print(random.randint(1,10))

7

What would be the output of the code: number = 3**2 Number = 2**3 print(number)

9

What is not a relational operator?

=

What symbol would be used to make a comparison of having two values be equal to each other?

==

Which statement is true regarding Python on a Mac?

A Mac comes with a version of Python already installed

Which coding language does not use a hybrid compiler/interpreter approach?

C++

Apply styles to cells, such as Headings and Titles and Data and Model, by using the ________ command in the Styles group.

Cell styles

When working with the Terminal inside of VSCode, how can you expand the pane?

Click the up arrow

Why doesn't a Python file execute when you double-click it?

Double clicking does not run the Python Interpreter on the source code

True or False: Python treats all numbers the same, regardless of numerical value

False

True or False: Source code is written in rich text

False

True or False: The code that's contained inside of a function is often called the function's legs

False

What data type in Python represents a number with a decimal point?

Float

What is not a benefit of functions?

Functions can eliminate crashes in your code

What value to not an argument to the "hello" function in the following code: def hello(name): print("Hey,", name) hello("John") hello("Mya")

Hey

Which language is considered an interpreted language?

JavaScript

What would be the output of the code: first_name = "Jeff" #first_name = "Sara" print(first_name)

Jeff

What operating system can't be used to write Python programming?

None, any system is able to use Python

What is a concern that could be considered a disadvantage of Python under certain circumstances?

Python is a general-purpose-language

True or False: In programming, a crash is when your program stops early or freezes because something unexpected happened.

True

True or False: The Watch Window is useful to monitor cells in one part of a workbook while working on another part of the workbook

True

True or False: To get Python code suggestions, you need to tell VS Code which Python interpreter to use.

True

True or False: With Goal Seek, you can work backward from the desired outcome to find the number necessary to achieve your goal

True

True or False: With if-else statements, we will always execute one of the code blocks depending on the result of the condition test

True

What command will start the Python prompt on your computer?

python3

You have Python 3 installed. How will you run the Python code in the file "process.py" on the command-line prompt?

python3 process.py

What would be the output of the code: if (num>=0): print(num) else: print(-1*num)

the absolute value of num

Why are there many programming languages?

to address many different computing needs

Why does VS Code need a Python interpreter to be specified?

to provide code suggestions

In Python, the data type int, will store what?

typed out positive or negative whole numbers

What is an example of an if-else statement that will not produce an output that is divisible by 3?

num = 16 if num % 3 == 0: print("is divisible by 3") else: print("is not divisible by 3")

In Python, the type float, which one is a float?

numbers with a decimal point

The total amount that a series of future payment is worth is called the ________

principal

How would you write the "Hello, world!" program in Python?

print("Hello world!")

What would not output: I'm learning a lot!

print('I'm learning a lot!')

Which IDE feature allows you to get code suggestions while you are typing?

IntelliSense

True or False: In a Lookup formula, the defined range is referred to as the table array.

True

What operator do you use to assign a value to a variable?

equals (=)

What command exits from the Python command-line prompt?

exit()

What letter do we put in front of a String if we want to put variables in it?

f

Given the following code, how would the function be called: def hello(name): print("Hey,", name)

hello("John")

What is an invalid reason for the selection of focussing on Python?

highly performant

What code can be used to print if a test score is a pass or a fail?

if (score>=60): print("passed") else: print("failed")

To use the Random module, what must we include at the top of our code?

import random

In Python, to add a value at a specific location in a list what command is used?

insert()

Programming can be defined as: converting ideas into _______ that a computer can understand

instructions

What data type is a whole number?

int

If you were writing your source code in the JavaScript programming language, what file extension would you use to save your file?

.js

If you were writing your source code in the Python programming language, what file extension would you use to save your file?

.py

What is the standard extension to use for a Python source code file?

.py

What would be the output of the code: def mult_inv(num): return 1/num result=mult_inv(3) print(result)

0.333333333

**How would you fix the code "1,000%300" to return the remainder of 1,000 divided by 300?

1000%300

In the Python Terminal, what is printed when running the following line "5*2+1"?

11

What does the expression "2*3+2*5" evaluate to?

16

What is an example of an expression with a syntax error?

2(4*2)

How many quotes are used to make a multi-line string?

3

What would be the output of the code: number = 10 if number % 4 == 0: print(number, "is divisible by 4") print("All done")

All done

What program does Nick use to write Python in the videos?

Replit

Given the first line of the code below, which programming language is this: def factorial(number)

Ruby

This if else statement is written in _____: if "apples" == "apples" puts "You're comparing the same thing" end

Ruby

In the Data Validation dialog box, you can create a ________ that will display when the cell is selected and that provides instructions to the person entering data.

ScreenTip

Which Mac application allows you to run commands and execute scripts in a command-line interface?

Terminal

What is the issue with the following code: number = input("Enter a number: ") if number == 10: print("The number is greater than 10.) else: print("The number is less than 10.")

The conditional statement is checking for equality

What would be the output of the code: num = 16 if num % 3 == 0: print(num, "is divisible by 3") print("The end")

The end

What does the keyword, void, mean when it is specified before a function definition?

The function does not return a value

Why is there no output for the following code: def goodbye(): print ("Bye")

The goodbye function was never called

What is the issue with the following code as defined: def double(): print(x*2)

The number to double is not received

Why do computer instructions need to be sequential?

The order in which these instructions are executed is important

What would be the output of the code: def compare(): print(5, "is greater than", 6)

This code will not print anything

True or False: If you create a defined name and then decide that you no longer need it, you can delete the name and its associated range reference.

True

If you were developing an application for an iPhone, which IDE would you use?

XCode

What is a true statement regarding Python support in VS Code?

You need to install a VS Code extension to support Python

What symbols surround a list when creating it?

[]

In the following code, the variable "name" is ____: def hello(name): print("Hey,", name)

a parameter

Which tool is used to write source code?

a text editor

What would not be considered a string?

any int, whole number

________ is the process of examining a worksheet for errors in formulas.

auditing

Multiple statements grouped together are called a ______

block

Any expression that breaks down to either true or false is called conditional, or ______

boolean expression

What can the following code be used for: def mystery(x): if (x % 2 == 0): return("yes") else: return("no")

checking whether a number is even or odd

What keyword does Python use to define a function?

def

What is an example of a runtime error?

name = "It's me!" print("Hello.", Name)

When would a removal of white space be problematic?

removing the space after the "if" in "if x==1"

What Python keyword is used to send back values from a function?

return

This code, "x = 5 print("x")" which is supposed to print the value of the variable x, is not working. Which category does the error fall under?

semantic

Although Python ignores empty lines, one place where whitespace does make a difference inside of ______

special keywords

What would be the output of the code: variable = "12" print(type(variable))

str

Typing "What is 2 plus 2?" into Python prompt causes a ______

syntax error

What symbol is not used for math in Python?

x

What would be the output of the code: age = 18 if age>=18: print("you are an adult") else: print("you are still a child")

you are an adult

What would be the output of the code: age = 17 if age>=18: print("you are an adult") else: print("you are still a child")

you are still a child

What symbols surround a dictionary when creating it?

{}


Conjuntos de estudio relacionados

Listening to Western Music Ch. 12 quiz

View Set

Geometry - Reasoning and Proof Unit Test

View Set

Completing the Application, Underwriting and Delivering the Policy

View Set

CH 13: Key Pediatric Nursing Interventions

View Set

Psych Final Exam, Psychology Final Review

View Set

Chapter 16: Nursing management during the postpartum period

View Set