100% tevredenheidsgarantie Direct beschikbaar na je betaling Lees online óf als PDF Geen vaste maandelijkse kosten
logo-home
Computer Science 114 Summary $4.53
In winkelwagen

Samenvatting

Computer Science 114 Summary

1 beoordeling
 1 keer verkocht
  • Vak
  • Instelling

Complete summary and guide to Computer Science 114, 1st year, 1st semester module. Includes a summary of all content covered as well as important pieces of code which are examined. The ultimate summary to succeed in computer science.

Voorbeeld 2 van de 5  pagina's

  • 10 augustus 2023
  • 5
  • 2023/2024
  • Samenvatting

1  beoordeling

review-writer-avatar

Door: ndemangokholo • 10 maanden geleden

avatar-seller
Computer Science Notes CS 114
Strings
General

string[x] - returns the character at that position in the string.

string[0:2] - returns the 1st and 2nd characters [incl. : excl.]

string[1:len(string)-1] - returns the middle of the string

len(string) - returns the length of the string. (cat = 3)

+ - concatenate string.

== - checks if the strings are the same.

.contains(str) - checks if a string contains a certain string

.index(str) - returns the position of the character in the string



Manipulative Methods

.upper() - converts the string to uppercase

.lower() - converts the string to lowercase

.casefold() - converts string to lowercase, includes additional characters

.replace(old, new, count) - replaces certain characters in a string with the new input




Ethan Ganz 1

, Arithmetic
Functions

+ - addition

- - subtraction

/ - normal division ( = 2.5)

// - floor division (5 // 2 = 2)

* - multiplication

**2 - to the power of 2 (**5 = to the power of 5)

Note: - Considers order of operation

print(str(x) + ‘ ‘ + str(y)) - prints “x y” (x and y are integers or floats)



Methods

max(a, b, c) - returns the variable with the largest value.

min(a, b, c) - returns the variable with the smallest value.

abs(x) - returns the absolute value of x.

abs(x) % 10 - returns the last digit of the number.



Math class

math.sqrt() - returns the square root of a float

math.exp(a) - e to the power of a

math.log(a, b) - log a with base b

math.pi - pie

math.e -e (2.718281828459045…)



Random class

random.random - random float between [0, 1)

random.uniform(a, b) - random float between [a, b] (or [a, b) )

random.int(a, b) - random int between [a, b]

random.range(a, b, c) - random int between [a, b) within the increment c

random.shuffle(a) - shuffles array a randomly (works with 1D or 2D array)

random.gauss(a, b) - Gaussian distribution (a = mu, b = sigma)


Ethan Ganz 2

Dit zijn jouw voordelen als je samenvattingen koopt bij Stuvia:

Bewezen kwaliteit door reviews

Bewezen kwaliteit door reviews

Studenten hebben al meer dan 850.000 samenvattingen beoordeeld. Zo weet jij zeker dat je de beste keuze maakt!

In een paar klikken geregeld

In een paar klikken geregeld

Geen gedoe — betaal gewoon eenmalig met iDeal, creditcard of je Stuvia-tegoed en je bent klaar. Geen abonnement nodig.

Direct to-the-point

Direct to-the-point

Studenten maken samenvattingen voor studenten. Dat betekent: actuele inhoud waar jij écht wat aan hebt. Geen overbodige details!

Veelgestelde vragen

Wat krijg ik als ik dit document koop?

Je krijgt een PDF, die direct beschikbaar is na je aankoop. Het gekochte document is altijd, overal en oneindig toegankelijk via je profiel.

Tevredenheidsgarantie: hoe werkt dat?

Onze tevredenheidsgarantie zorgt ervoor dat je altijd een studiedocument vindt dat goed bij je past. Je vult een formulier in en onze klantenservice regelt de rest.

Van wie koop ik deze samenvatting?

Stuvia is een marktplaats, je koop dit document dus niet van ons, maar van verkoper ethanganz. Stuvia faciliteert de betaling aan de verkoper.

Zit ik meteen vast aan een abonnement?

Nee, je koopt alleen deze samenvatting voor $4.53. Je zit daarna nergens aan vast.

Is Stuvia te vertrouwen?

4,6 sterren op Google & Trustpilot (+1000 reviews)

Afgelopen 30 dagen zijn er 65040 samenvattingen verkocht

Opgericht in 2010, al 15 jaar dé plek om samenvattingen te kopen

Begin nu gratis

Laatst bekeken door jou


$4.53  1x  verkocht
  • (1)
In winkelwagen
Toegevoegd