Python Fundamentals Flashcards

1
Q

Python Features?

A

Easy to code
High level language
Case sensitive
OOPS
Portable
Interpreted language

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

Python uses?

A

AI, Data science, Deep learning, machine learning

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

IDLE?

A

Integrated development learning environment

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

Name some offline code editors

A

Jupyter, Spyder, Pycharm, VS code

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

Name some online code editors

A

Google collab, Github, W3 schools, geek for geeks

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

IDLE modes?

A

Interactive mode (Difficult to edit) → python shell

Script mode (Difficult to save) → file

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

Python character sets?

A

Set of valid characters a language can recognize
-+)%$awfa etc

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

Tokens/ Lexical units?

A

Smallest individual unit in a program

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

Tokens types?

A

Keywords, literals, operators, identifiers, punctuators

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

Keywords?

A

convey special meaning, reserved for special purpose. Cant be used as variables. There are 33 such keywords

if else elif etc

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

Identifiers?

A

Fundamental building blocks of python. User defined.

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

Identifier rules?

A

Cant contain special characters except ‘_’
Cant use keyword as identifier
First character must be letter( _ counts)
No space in between

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

Literals?

A

Data items having fixed value

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

Types of literals?

A

String literals
Numeric literals
Boolean literals
Special case ‘none’
Literal collections

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

Operators?

A

Tokens that trigger →computation

when applied to variables.

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

Operands?

A

Variables to which computation is applied

16
Q

Operator Classifications?

A

→Unary operator (require 1 operand)
→Binary operator (require 2 operand)

17
Q

Operator types?

A

→arithmetic(+,-/,*,//,%,**)→comparision(>,<)
→assignment(=, +=)
→logical(and, or, not)
→membership(in,notin)
→identity ( is, is not)

18
Q

Punctuators?

A

Symbols used to organize sentences structures and indicate rhythm
@$!<>, ; etc

19
Q

What are datatypes?

A

Type of data given to a variable

1)Numerical (int, float, complex)
2)Boolean (True & false)
3)Sequential (strings)
4)Collection(list, tuples)

20
Q

Dictionaries (dict.)?

A

a=3
print (type(a))
o/p: class <int></int>

21
Q

Strings?

A

Quotation enclosed sequence of characters.
“a’, “xyz”, ‘abc’

22
Q

How to access character in string?(Indexing)

A

Indexing:

Hello world
01234 5 678910
str1= “Hello world”
print (str1[10])
o/p → d

23
Q

Indexing specific characters or skipping?

A

Hello world
01234 5 678910
str1= ‘Hello world”

[Start→Includes index Stop→ Doesn’t include index
Step→ Skipping characters]

24
Mutability?
Data types which **can change value** in a statement Ex: Lists, dictionaries
25
Immutability?
Data types which **cannot change value** in a statement Ex: Strings, tuples
26
what are Lists?
**Collection** of different types of elements within **square brackets**. They are **mutable** L= ['1', '2", ("a","b")]
27
what are tuples?
**Collection** of different types of data within **curved brackets**. They are **immutable**
28
Dictionaries?
Collection of key value pair elements within **flower brackets** They are mutable
29
Dictionary syntax?
D= {: ,:} D= {'a':1, 'b':2, 'c':3} print (D['b']) #2
30
What is type casting?
**Conversion of types of data** either forcefully or automatically →Implicit (Automatic) a=2 ,b=3.4, c= a +b print (type(c)) #float →Explicit (Forced) a=2 print (type(a)) #int a= float(a) print (a) #2.0