Python

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

Which conditional operator is used to check if things not equivalent (not equal) to each other?

!=

What is the symbol used to start a comment?

#

What is the result of... 5 // 2

2

What is the result of... 5 / 2

2.5

What is the result of... 7 % 4

3

What is the assignment operator?

=

What is the comparison operator that means equivalent (equal) to?

==

What is the IDLE command prompt?

>>>

What can be described simply as a mini-program that goes off and performs a specific task?

A function

Values that are passed to functions are called what?

Arguments

Python differentiates between upper and lower case letters so that 'print' and 'PRINT" are not the same. What is this called?

Case sensitive

Strings can be put together using the plus sign (+). What is this called?

Concatenation

Every if statement has an expression that evaluates to True or False. What is this called?

Condition

What does the float(var) function do?

Convert var to a number w/decimal

What does the str(var) function do?

Convert var to a string

What does the int(var) function do?

Convert var to an integer

Python is able to run on many different operating systems like Windows, Mac & Linux and a program created on any of these can run on the others. What is this called?

Cross Platform

Variables are containers in memory. What do they contain?

Data and Information

If you want to print quotes, you need to use something like this \" or \'. What are these called?

Escape Sequences

What are the two types of numbers discussed in class?

Integer and Float

What is IDLE? (not the person)

Integrated Development Environment

Multiplying two numbers when you should divide them is what kind of error?

Logic

10 > "five" will not work as a comparison. Why?

Python can only compare objects of the same type

Assignment statements take what's on the __________ and assign it to the variable on the _________.

Right/Left

Adding a number and a string is what kind of error?

Runtime

What are the two modes of IDLE?

Script and Interactive

Which one is NOT a reason for commenting your code?

So someone else looking at your code can understand it. So you can understand it after not looking at it for a while. To make the code look pretty. Because you will lose points if there are no comments

A complete Python instruction is called a...?

Statement

What type of data does the input function always get from the user?

String

Missing a parenthesis is what kind of error?

Syntax

In Python special words that are part of the Python language are colored purple and strings are always green. What is this called?

Syntax Highlighting

Which variable name is illegal?

Total_Cost 2ndLine homeAddress

What escape sequence is used to move the output to the next line?

\n

What escape sequence is used to put a tab into your output?

\t

Which variable name is illegal?

_MTK input eleMEnt

Which variable name is illegal?

a b5 H$

An if statement is built by using an if followed by a __________________, a ______________ and a ______________ of one or more statements. Example: if(price > 100): total = price + total print("That is too much money")

condition, colon & block

The % is called mod or modulus and performs...

division and returns the remainder

To evaluate a sequence of conditions we can add numerous ______________ to an if.

elifs

This can be described simply as a mini program.

function

Python provides a lot of built in functions that can be imported. Where are these functions contained?

in modules

What is a block of code?

indented code after an if, elif or else

What function is used to get information from the user?

input

These are similar to functions, but cannot be called on their own; they must be called through a particular object like a string. What are they called?

methods

Which is NOT a valid string method?

name.edit( )

This Python function is used to display output to the screen.

print

Writing a mix of English and Python to plan your program is called using...

pseudocode

What TWO functions are used to generate random numbers?

randint( ) & randrange( )

This data type consists of characters enclosed in quotes.

string

What data type consists of characters enclosed in quotes?

strings

This can be described as a container in memory that holds data.

variable

Which variable name is illegal?

yAh00 grade_point_average 1ine


संबंधित स्टडी सेट्स

OM-7S, Chapter 7 Process Strategy, Ops Exam 2, Productions & Operations MGMT Chapter 6- Managing Quality

View Set

Body, Diagnosis, Equipment, Instruments, and Treatment (3)

View Set

Business Math: Unit 3 Test (Ch. 13, 14, 15, & 16)

View Set

PrepU - Legal I Dimension of Nursing Practice

View Set

Honors Physics Chapter 7 - Momentum and Collisions

View Set

ADV 319 Psychology of Advertising Exam #1

View Set