- Keys:
for key in my_dict:ormy_dict.keys() - Values:
for value in my_dict.values(): - Key-value pairs:
for key, value in my_dict.items():
Stanford CS106A - Python Programming Methodology
Unlock core Python programming skills with this comprehensive flashcard deck, mirroring Stanford CS106A's foundational concepts. Ideal for beginners, master variables, control flow, functions, data structures, and algorithmic thinking for robust problem-solving.
Cards in this deck
(21 cards)Preview terms and definitions before starting your study session.
x = 10, name = "Alice".int: Integers (e.g., 5, -100)2.
float: Floating-point numbers (e.g., 3.14, -0.5)3.
str: Strings (sequences of characters, e.g., "hello")4.
bool: Booleans (either True or False)int(), float(), str(), and bool().Example:
num_str = "123"
num_int = int(num_str) # Converts string "123" to integer 123if/elif/else statement.True.if condition1:
# code if condition1 is True
elif condition2:
# code if condition1 is False and condition2 is True
else:
# code if all conditions are Falsefor loop?range() function. range(n) generates numbers from 0 up to (but not including) .Example:
for i in range(5):
print(i) # Prints 0, 1, 2, 3, 4while loop instead of a for loop?while loop is used when the number of iterations is not known beforehand and depends on a condition remaining True. A for loop is typically used when iterating over a sequence or a known range.Example:
count = 0
while count < 3:
print(count)
count += 1def add_numbers(a, b):
return a + b
result = add_numbers(5, 3) # result will be 8Related Flashcard Sets
Explore similar study materials created by the community
HSK 1 - Basic Chinese Vocabulary, Pinyin & Character Recognition
Master foundational Mandarin Chinese with this HSK 1 flashcard deck covering essential vocabulary, Pinyin pronunciation rules, tones, and core sentence patterns.
Functional Programming - Immutability, Pure Functions & Higher-Order Functions
Unlock the power of Functional Programming! Master immutability, pure functions, and higher-order functions to write predictable, testable, and concurrent code with this comprehensive flashcard deck.
Neuroscience - Neuroanatomy & Brain Function
Master high-yield neuroanatomy and functional neuroscience concepts with this comprehensive study deck. Perfect for medical students and biology majors covering brain regions, cranial nerves, neuronal action potentials, and major pathways.
Microsoft Azure Administrator (AZ-104) - Compute, Storage & Networking
Master core AZ-104 certification concepts including Microsoft Entra ID, Azure Storage, Virtual Networks, Virtual Machines, and Azure Monitoring with this high-yield flashcard deck.