Intro to programming- terms

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

1/10

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

11 Terms

1
New cards

Function

  • block of reusable code that performs a specific task.

  • Syntax: Defined using the def keyword.

  • example: def function_name(parameters):

2
New cards

Reusable Code

  • Allows the same code to be performed multiple times without duplication

3
New cards

Parameters

  • Inputs that the function can accept.

  • Syntax: def function_name(parameters):

  • example: def add_numbers(a, b):

4
New cards

Return Value

  • The result that it gives back when you use it

  • Syntax: return

  • example: return a + b

5
New cards

Input function

  • lets users enter information.

  • Syntax: input("Prompt message")

6
New cards

Print function

  • A Python function that shows information on the screen.

  • Syntax: print("Message or variable")

7
New cards

Type Checking

  • Checking what kind of data a variable holds.

  • syntax: type(variable)

8
New cards

Random Module

  • A Python module for generating random numbe

  • Import Syntax: import random

9
New cards

Random Number Generation

  • Description: Provides functions for generating random integers.

  • Example: random.randint(start, end)

10
New cards

Commenting

  • Notes in the code that are not performed

  • syntax: #

11
New cards

Sum

  • adds up numbers and gives total

  • syntax: sum(variable)