Introduction Flashcards

1
Q

What is IEEE Spectrum ?

A

IEEE Spectrum is the flagship magazine and website of the IEEE - Institute of Electrical and Electronics Engineers

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

What is a Code ?

A

The term code refers to anything written in a programming language to provide instructions to a computer

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

What is Coding?

A

The term coding is often used to describe the act of writing code.

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

What is an Code Editor ?

A

A code editor is an app that lets you type code.

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

What are the various code editors ?

A

Anaconda,VS Code Editor ,Pycharm,Jupiter Notebook,
Aptana Studio.

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

How to start python in VS Code ?

A

Goto view-Terminal .

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

How to add two numbers in python Terminal ?

A

>>> 1+1
2
>>>

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

How to exit from python terminal in vs code editor?

A

ctrl + d in Linux ,or exit() or quit() functions.

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

How to know python version using Linux terminal ?

A

python –version
or python -V

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

Which languages supported by jupitor notebook ?

A

Julia,Python and R,
Julia & R popular for data science

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

How to get help in python terminal ?

A

Goto python terminal …
>>> help()
help>

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

How do get help in the python terminal?

A

Goto python help terminal…
>>>help()
help>keywords
help>symbols
help>modules

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

How to exit from help terminal in python ?

A

ctrl + c and q

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

How to zoom in out in vs code ?

A

ctrl + for zoom in
ctrl - for zoom out

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

How to show aphorisms of python?

A

Type import this on python interpreter.

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

Who wrote Zen of Python & how to get them?

A

The Zen of Python wrote by
Tim Peters.
Type import this on python interpreter.

17
Q

What are PEP20 in python ?

A

The Zen of Python is sometimes referred to as PEP 20.The acronym is Python enhancement proposals.
20 refers to the 20 Zen of Python
principles, only 19 of which have been written down.

18
Q

Where to find peps online ?

A

Navigate to www.python.org/dev/peps

19
Q

What is Style Guide for Python Code.

A

Style Guide for Python Code is an PEP-8,It is all about Python
Coding Style Guidelines from the Python.org website.
https://www.python.org/dev/peps/pep-0008/

20
Q

What is PyLint ?

A

PyLint is a tool in Anaconda that makes suggestions about your code
as you’re typing.

21
Q

How to know installed python modules in anaconda ?

A

Goto enviroments, see right side pane for installed modules.
They are installed with anaconda.

22
Q

How to know installed modules using Terminal ?

A

goto python help and search for modules.
# python
>>>help()
help>modules

23
Q

What are docstrings in python ?

A

Multiple line comments enclosed within triple quotation marks are docstrings.
“””
This is an dockstring
“””

24
Q

How to use python comments ?

A

Two Methods,

  1. for single line comments use # symbol.
  2. for multiline comments use docstrings.
25
Q

How to import modules in python ?

A

import modulename
import modulename as alias
import random
import random as rnd

26
Q

How numbers start in python to store it in variables ?

A

Number in python should be starts with number 0-9 > 1,10
,decimal sighn > .1 , .326
,or hypen sighn > -22

27
Q

How many types of python GUI Frameworks ?

A
  1. PyQt5
  2. Tkinter
  3. Kivy
  4. wxPython
  5. Libavg
  6. PySimpleGUI
  7. PyForms
  8. Wax
  9. PySide2
  10. PyGui
    https: //towardsdatascience.com/top-10-python-gui-frameworks-for-developers-adca32fbe6fc
28
Q

Using Line Break & semicolon in python ?

A

You can use line break or semicolon to separate statements.
The code runs the same whether you end each line with a break or a semicolon.

firstName = “Hemant”; lastName = “Kumar”;print(firstName,lastName)

or

firstName = “Hemant”
lastName = “Kumar”
print(firstName,lastName)

29
Q

How to Print variables in Python ?

A

name = “Hemant”; age = 32;

print(name,”Age is : “,age)

30
Q

How to write if else statement in python ?

A

x = 10

if x==0:
print(“x is Zero”)
else:
print(“Value os x is :”,x)

31
Q

Explain These Functions?

type()
bin()
max()
min()

A

type(x) returns datatype of x.
bin(x) returns binary of x
max(x,y,z,..) returns largest value.
min(x,y,z,..) returns minimum value

32
Q

What is f strings?

A

Format strings are used to format strings.Used to assighn formated value to variable or in print statement.Format string has two parts ,literal part and expression part.
name = ‘Hemant’
x = f”Name - {name}”
print(x)

username = Hemant
f”Hello {username}”
username = “Alan”
print(f”Hello {username}”)

unit_price = 49.99
quantity = 30
print(f”Subtotal: ${quantity * unit_price}”)

The f before the first quotation mark tells Python that what follows is a format string. Inside the quotation marks, the text, called the literal part, is displayed lit-erally (exactly as typed in the f-string). Anything in curly braces is the expression part of the f-string, a placeholder for what will appear when the code executes.Inside the curly braces, you can have an expression

33
Q

How to format value in thousand ?

A

x = 174310.24567
print(f”Total value is Rs.{x:,.2f}”)

34
Q

How to encased f-strings?

A

An f-string can be encased in single,double, or triple quotation marks.

x = 12000.345

print(f”Total Value is Rs.{x:,.2f}”)

print(f’Total Value is Rs.{x:,.2f}’)

print(f”"”Total Value is Rs.{x:,.2f}”””)

print(f’'’Total Value is Rs.{x:,.2f}’’’)

35
Q

How to Format percent numbers?

A

salesTaxRate = .065

print(f”Sale Tax Rate {salesTaxRate:.2%}”)
Running this code multiples the sales tax rate by 100 and follows it with a % sign,

36
Q

How to print value of variable with format strings ?

A

x = 26

print(f”value of x is : {x}”)