Garantie de satisfaction à 100% Disponible immédiatement après paiement En ligne et en PDF Tu n'es attaché à rien
logo-home
Summary Final cheat-sheet $9.38
Ajouter au panier

Resume

Summary Final cheat-sheet

 0 fois vendu
  • Cours
  • Établissement

This document contains

Dernier document publié: 8 mois de cela

Aperçu 1 sur 3  pages

  • 17 juillet 2024
  • 17 juillet 2024
  • 3
  • 2023/2024
  • Resume
avatar-seller
Indexing and range (starting from 0 by default)
○ [start (inclusive) : end (exclusive) : stepsize (optional)] = [0, 1, 2, 3] = [-4, -3, -2, -1]. Tip: end - start is the number of elements returned.
○ Range(start (inclusive), stop (exclusive), stepsize). Range(3): 0, 1, 2. The start, stop and step parameters work the same as in list slicing.
○ Set function is used to create a set, particularly useful for removing duplicates from a list or character returns as { }. There is no order.
○ 1: 8: 3 is going to give us: 1, 4 and 7!


Scope (local and global names)
○ Global variables are defined outside functions and are accessible everywhere, but a local variable with the same name inside a function take
precedence (dominates). If a variable isn’t found locally, only then Python looks in the global scope. The global keyword allows modifying
global variables within functions.


String methods (immutable, all of these methods are non-mutating string methods)
○ Escape characters can also be used to include quotes or specific characters: \\ = \, \’ = ‘, \” = “, \n = go to the next line, \t = insert a tab.
○ The individual character(s) of a string can be accessed directly using zero based indexing just like with lists.
○ str.index(value, start, end) – returns the index of the first occurrence of the specified value within the slice (works with strings too)
○ len(x) – returns the number of elements in a list or the number of characters in a string, including spaces, punctuation and other characters.
○ sorted(x) – returns a new list containing all items from x in ascending order. When reverse = True it returns a new list containing all items
from x in descending order. Sorted( ) does not change the original list itself. Works with strings too.
○ str.capitalize( ) – returns a copy of the string with only the first character capitalized and the rest lowercase. It doesn’t change the string, but
returns a new string. You must give that new string a name else you cannot use it in the print statement.
○ str.upper( ) – returns a copy of the string with all alphabetic characters converted to uppercase, leaving the original string unchanged.
○ str.lower( ) – returns a copy of all the characters of the string converted to lowercase.
○ str.isupper( ) – returns True if all characters in the string are uppercase, otherwise it returns False, str.islower( ) it is vice versa.

Les avantages d'acheter des résumés chez Stuvia:

Qualité garantie par les avis des clients

Qualité garantie par les avis des clients

Les clients de Stuvia ont évalués plus de 700 000 résumés. C'est comme ça que vous savez que vous achetez les meilleurs documents.

L’achat facile et rapide

L’achat facile et rapide

Vous pouvez payer rapidement avec iDeal, carte de crédit ou Stuvia-crédit pour les résumés. Il n'y a pas d'adhésion nécessaire.

Focus sur l’essentiel

Focus sur l’essentiel

Vos camarades écrivent eux-mêmes les notes d’étude, c’est pourquoi les documents sont toujours fiables et à jour. Cela garantit que vous arrivez rapidement au coeur du matériel.

Foire aux questions

Qu'est-ce que j'obtiens en achetant ce document ?

Vous obtenez un PDF, disponible immédiatement après votre achat. Le document acheté est accessible à tout moment, n'importe où et indéfiniment via votre profil.

Garantie de remboursement : comment ça marche ?

Notre garantie de satisfaction garantit que vous trouverez toujours un document d'étude qui vous convient. Vous remplissez un formulaire et notre équipe du service client s'occupe du reste.

Auprès de qui est-ce que j'achète ce résumé ?

Stuvia est une place de marché. Alors, vous n'achetez donc pas ce document chez nous, mais auprès du vendeur EBEdocuments. Stuvia facilite les paiements au vendeur.

Est-ce que j'aurai un abonnement?

Non, vous n'achetez ce résumé que pour $9.38. Vous n'êtes lié à rien après votre achat.

Peut-on faire confiance à Stuvia ?

4.6 étoiles sur Google & Trustpilot (+1000 avis)

75197 résumés ont été vendus ces 30 derniers jours

Fondée en 2010, la référence pour acheter des résumés depuis déjà 15 ans

Commencez à vendre!

Récemment vu par vous


$9.38
  • (0)
Ajouter au panier
Ajouté