返回卡包市场

CS 10 Unit 2

暂无描述。系统推荐的高质量记忆内容,适合每天坚持背诵学习。

卡片总数: 10内容版本: v4公开卡包更新时间: 8/1/2026

卡片预览 (10 张)

#1
正面 (问题)

What are the three aspects for an if statement in python?

背面 (解答)

It is a decision structure, it can cause an execution to have more than one path of executions(if true, then you do this, if false, then do this(else)), and what is executed is determined by the boolean values that goes into the statements

#2
正面 (问题)

True or false, an if statement can only have one line of execution

背面 (解答)

False, it can have multiple (ex: If condition(true): condition condition condition

#3
正面 (问题)

True or false, the actions are skipped if the boolean value is false

背面 (解答)

True, if it is false, then the conditions after the if statement won’t run

#4
正面 (问题)

What are all the different comparison operators

背面 (解答)

==, <=, >=, !=, <, > (keep in mind that it’s not =<, it’s <= (the greater or less than sign first), just read it from left to right and then it will make sense)

#5
正面 (问题)

What are examples of the not function, the boolean or boolean statement, and the boolean and boolean statement

背面 (解答)

temp = 9 if not(temp > 10): print(“True”) (only do semicolon in c++) if temp > 5 and temp < 10: print(“True”) if temp > 5 or temp < 6: print(“True”) (don’t need paranthesis)

#6
正面 (问题)

Why is a namespace useful?

背面 (解答)

If you have two of the same variable names in different namespaces, you reduce confusion for which one is which because you can put the namespace::variable name or whatever (some format like that)

#7
正面 (问题)

How to get a size of a string in C++

背面 (解答)

You do variable of the string name period size();

#8
正面 (问题)

How do you print out “Hello World!”

背面 (解答)

include <iostream></iostream> int main() { std::cout «_space;“Hello, World!” «_space;std::endl; return 0; }

#9
正面 (问题)

How do you print out “Hello World!” while using the std namespace (which is actually built in C++)

背面 (解答)

include <iostream></iostream> using namespace std; int main() { cout «_space;“Hello World!” «_space;endl return 0; // you always have to return an integer } // you do not have to include the namespace std before this, as you specified in the second line that you are using the namespace

#10
正面 (问题)

背面 (解答)