what does print() in python do?
print to the terminal
This Python keyword is used to create your own error messages
What is raise?
// whats wrong with this code:
#include <iostream>
int main() {
cout << "hi";
}
using cout without:
using namespace std;
!
This mode in Python file handling is used when you want to read a file and is represented by the letter 'r'
What is read mode?
does the first public class thingy have to be the file name?
YES
declare a variable called name and assign it with the value of john
code:
name = "john"
This special method in Python classes starts with double underscores and runs automatically when creating a new object
What is __init__?
In C++, what punctuation mark must appear at the end of most programming statements?
What is a semicolon (;)?
This command is always important to use when you're done working with a file in Python
What is file.close()?
Every Java class name must begin with this type of letter
What is a capital/uppercase letter?
This symbol is used to create comments in Python
what is #
what does exec() do
execute a string in python
These two symbols (<<) in C++ are called this operator when used with cout
What is the insertion operator?
in python, im gonna open a file in read mode. But im doing it on programiz!!!! what will happen?
Segmentation Fault
whats wrong about this code
public class Calculator { public static void main(String[] args) { int number1 = 10 int number2 = 20; System.out.println("The sum is:" + number1 + number2) } }
it is any of these answers
1. MISSING SEMICOLON(S)!!!
2. you cant add string to number
In Python, how do you make a list?
[]
HOW TO MAKE PYTHON NOT MAKE __PYCACHE__
# one of these:
#1. python:
import sys
sys.dont_write_bytecode
#2. bash:
export PYTHONDONTWRITEBYTECODE = 1
This header file must be included to use cout and cin in C++
What is iostream?
This built-in Python function turns each line of a file into a list item you can work with
What is file.readlines()?
This is the correct way to create a String variable in Java
What is String variableName = 'text'?
what if i do
if False:
pass
the if will never execute because False will never equal True
This Python concept uses the '@' symbol and modifies function behavior without changing the function itself
What is a decorator?
This special function in C++ runs automatically when the program starts
What is main()?
Using this statement with file handling means you don't need to close the file manually
What is 'with open()' statement?
This special word in Java means a variable belongs to the class itself, not to any specific object
What is static?