Python 1 Flashcards

1
Q
  • has undoubtedly risen to prominence as a versatile and user-friendly programming language.
  • Its simplicity and readability have attracted a vast developer community.
  • However, like any tool, it comes with its own set of strengths and weaknesses.
A

Python

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

python advantages

A
  1. readability and simplicity
  2. large and active communities
  3. versatility
  4. extensive libraries
  5. open source
  6. rapid development
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Python’s syntax is clean and resembles natural language, making it easy to learn and understand.

A
  • Readability and Simplicity
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

A vast community of developers contributes to Python’s growth, providing extensive support and resources.

A
  • Large and Active Community
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

: Python boasts a rich ecosystem of libraries

A

extensive libraries

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Python is applicable in various domains, including web development, data

A

versatility

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Being open-source, Python is free to use, modify, and distribute.

A

open source

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Python’s interpreted nature and high-level abstractions facilitate rapid prototyping and development

A

rapid development

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Python’s interpreted nature can lead to slower execution compared to compiled languages like C++ or Java.However, for many applications, this performance difference is negligible.

A

speed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

This limits Python’s ability to fully utilize multiple CPU cores, impacting performance in multi-threaded applications.

A
  • Global Interpreter Lock (GIL)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

python disadvantages

A
  1. speed
  2. global interpreter lock
  3. dynamic typing
  4. memory consumption
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

While flexible, dynamic typing can sometimes introduce runtime errors if not handled carefully

A
  • Dynamic Typing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Python can be relatively memory-intensive compared to other languages.

A
  • Memory Consumption
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

when to use python

A
  1. rapid prototyping and scripting
  2. data analytics and machine learning
  3. web deveopment
  4. automation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Its ease of use and speed of development make it ideal for quickly creating prototypes.

A
  • Rapid prototyping and scripting
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Python’s rich ecosystem of libraries (NumPy, Pandas, Scikit-learn) provides powerful tools for data manipulation and modeling.

A
  • Data analysis and machine learning
14
Q

Frameworks like Django and Flask simplify web application development.

A
  • Web development
14
Q

Python excels at automating tasks, improving productivity

A
  • Automation
14
Q

Unlike many other languages, Python uses —— (specifically indentation) to define code blocks.

A

indentation, whitespace

15
Q

Comments

A
  • Single-line comments start with #
  • Multi-line comments can be enclosed in triple quotes (‘’’ or “””)
15
Q

Data Types

A
  1. numbers
  2. string
  3. list
  4. tuples
  5. dictionaries
  6. sets
16
Q

Integers, floating-point numbers, complex numbers

17
Q

Textual data enclosed in single or double quotes

18
Q

Ordered collections of items

19
Immutable ordered collections
* Tuples
20
Unordered collections of key-value pairs
* Dictionaries
20
control flow
1. if else 2. for 3. while 4. break 5. continue
21
Conditional execution
* if-else
21
Unordered collections of unique elements
* Sets
22
Iterating over sequences
* for
22
Looping until a condition is false
while
22
Exits a loop
break
22
Skips the current iteration
continue
23
* Python are simply containers for storing data values. * Think of them as labeled boxes where you can place different types of information. * Python doesn't require you to declare a variable's type beforehand; it determines the type automatically when you assign a value to it.
Variables
23
data types
1. number 2. string 3. boolean 4. list 5. tuple 6. dictionary 7. set
23
Variable Naming Conventions
* * Variable names can contain letters, numbers, and underscores (_). * * They must start with a letter or an underscore. * * Python is case-sensitive, so age and Age are different variables. * descriptive names for readability