100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Summary

Summary - Introduction to Programming for CIW (800873-B-6) (800873-B-6)

Rating
-
Sold
4
Pages
41
Uploaded on
15-12-2023
Written in
2022/2023

This document provides a comprehensive summary of the course “Introduction to Programming for CIW (800873-B-6)”. The summary covers essential concepts and programming skills taught in the course. It includes an overview of programming fundamentals, such as variables, data structures and control structures and concepts. Before your exam, it is especially important to know the concepts well. If you have a good command of literal definitions and functions, you are already halfway and you will most likely get a passing grade! This document provides a comprehensive summary of the course “Introduction to Programming for CIW (800873-B-6).” The summary covers essential concepts and programming skills taught in the course. It includes an overview of programming fundamentals, such as variables, data structures, and control structures and concepts. Knowing the concepts well is crucial for your exam. If you have a solid grasp of literal definitions and functions, you are halfway there and are likely to score well!

Show more Read less
Institution
Course











Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Study
Course

Document information

Uploaded on
December 15, 2023
Number of pages
41
Written in
2022/2023
Type
Summary

Subjects

Content preview

Week 1
Chapter 1 | Getting started with Variables and Values
Built-in functions
● print() → Outputs its argument to the screen.
● sum() → Sums up the numbers in the list.
● input() → Takes user input and returns it as a string.


Keywords
● Argument → Object you put in a function
● String → A sequence of characters
● Comment → Used to document our code and explain what’s happening
● Variable →
● Value →
● Re-assign a variable → The value of a variable changes


Calculations
● Summing → print(3+2)
● Subtracting → print(7-1)
● Multiplication → print(3*3)
● Division → print(10/3)
● Power → print(5**2)


Additional theory - Naming variables
1. Use clear, meaningful, descriptive variable names so that your code will remain
understandable.
2. Use the lowercase_with_underscores style, with lowercase characters and underscores
for separating words
3. Do not use built-in names, such as print or sum (these will turn green in Jupyter
Notebooks)

,Chapter 2 | Basic Data Types (Integers and Floats)
Built-in functions
● type() → To check object types.
Methods
● int() → Converts any number or string into an integer object.
● str() → Returns the string version of the object.
Keywords
● String → For representing text.
● Integer → For representing whole numbers.
Float → For representing numbers with decimals.
● Tuple → For representing immutable combinations of values.
● List → For representing ordered sequences of objects.
● Set → For representing unordered sets of objects.
● Dictionary → To represent mappings between objects
● Booleans → To represent the truth values True or False.
● Casting → Converting one type into another type.
● Coercion → Implicit type conversion. For example when you divide 2 integers with
each other the output is a float.
● Operator precedence → The order in which mathematical operations are performed.


Additional theory - Type affordances
It is possible to use “+” for adding up integers and floats. It is also possible to add strings
together. However, it is not possible to add strings and integers/floats up. Python will then
give an error.


Casting types
Not all conversions are possible. For example, we cannot make an integer of the string
“hello”.

,Mathematical operators

, Chapter 3 | Strings
Built-in functions
● repr() → Gives you the Python-internal representation of an object.
● len() → Lets you compute the length of a sequence. (spaces count as characters
too!)
● dir() → Returns a list of method names (as well as attributes of the object).
● help() → If you want to know what a specific method does.


Methods
● str.lower() → Turns a string into all lowercase characters
● str.upper() → Turns a string into all uppercase characters


Keywords
● Index number → The position of a character in a string. Positive index starts at 0.
Negative index starts at -1 and goes backwards.
● Mutability → Whether an object can change or not.
● Immutable → an object cannot be changed.
● f-strings → New string formatting mechanisms that make string interpolation
simpler.
● Method → A function that is associated with an object.
● Dunder methods → Method names that start and end with double underscores. They
are Python-internal.


Additional theory - Multi-line string
Two ways to span strings across multiple lines:
1. With single or double quotes, where we manually indicate that the rest of the string
continues on the next line with a backslash
→ \n (newline symbol) indicates that we want to start the rest of the text on a new
line in the string, the following \ indicates that we want the string to continue on the
next line of the code. Together ( \n\ ).
2. With three single or double quotes.
→ Another way to span strings across multiple lines is by simply using three single or
double quotes.
$7.10
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
ibdeheer

Get to know the seller

Seller avatar
ibdeheer Tilburg University
Follow You need to be logged in order to follow users or courses
Sold
12
Member since
3 year
Number of followers
8
Documents
5
Last sold
1 year ago

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions