BUS101 Midterm review

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall with Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/15

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No study sessions yet.

16 Terms

1
New cards

int

integer: number without a decimal

2
New cards

float

number with a decimal

3
New cards

str

string: text

4
New cards

input()

ask the user to type something in

5
New cards

input()

ask the user to type something in

6
New cards

Conditionals

  • If statement

  • else : stops asking questions and just runs, only used once if “if” statement is false

  • elif : Extra conditions, asks another question, can have multiple but stops once the previous ones are false

* For Else and Elif, you must exit the “If block” first

7
New cards

Comparison Operators: <,>, greater than or equal to, or less than or equal to

<, >, <=, >=, or ==

*= means an assignment, like print=

8
New cards

How to use a String

print(“Hello world”)

  • Make sure to use ““

  • Don’t need to write str

9
New cards

for loops

for item in collection

  • they repeat until the number of items in your collection.

  • EX. for name in [“Alice”, “bob”, “Charlie”]:

    • print(name)

10
New cards

Range()

  • this range starts at 0 and goes up to ,not including, the number inside the parens

Ex. For number in range(3):

  • print(number)

Outcome:

0

1

2

11
New cards

Range (#,#)

  • When you want to type down numbers in a certain range

  • you can do this two ways, one using just one number and adding an amount to the number using f””, or just giving the exact range with (x,x)

EX.

for num in range (7)

  • print(f”num +3”)

Output: 3,4,5,6,7,8,9

for num in range (3,9)

  • print(num)

Output: 3,4,5,6,7,8,9

12
New cards
13
New cards
14
New cards
15
New cards
16
New cards