Python: Chapts 1-3 Eric Matthes (A+ Verified Answers)
cd correct answers for change directory, to navigate through your filesystem in a command window dir correct answers dir for directory. Shows you all the files that exist in the current directory python --version correct answers test if python is installed or not pip -V correct answers verify if the pip has been installed correctly by performing a version check on the same title() method correct answers changes each word to title case, where each word begins with a capital letter upper() method correct answers Changes each letter of a string to upper case. lower() method correct answers Changes each letter of a string to lower case. The lower() method is particularly useful for storing data. Many times you won't want to trust the capitalization that your users provide, so you'll convert strings to lowercase before storing them. Then when you want to display the information, you'll use the case that makes the most sense for each string f-strings f"{} {}" correct answers The f is a format. To insert a variable's value into a string, place the letter f immediately before the opening quotation mark. Put braces around the name or names of any variable you want to use inside the string. Python will replace each variable with its value when the string is displayed. Ex: print(f"Hello, {full_()}!"). F-strings were first introduced in Python 3.6 t correct answers to add a tab. Ex: print("tPython") n correct answers To add a newline in a string. Ex: print("Languages:nPythonnCnJavaScript") rstrip() method correct answers To ensure that no whitespace exists at the right end of a string lstrip() method correct answers Strip whitespace from the left side of a string strip() method correct answers Strip whitespace from both sides of a string ** correct answers Exponents. Ex: 3 ** 2 underscores in numbers correct answers When you're writing long numbers, you can group digits using underscores to make large numbers more readable. Ex: 14_000_000_000 Multiple Assignment correct answers You can assign values to more than one variable using just a single line. Ex: x, y, z = 0, 0, 0
Document information
- Uploaded on
- March 25, 2024
- Number of pages
- 11
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers