Skip to content

Commit

Permalink
4. Working with strings
Browse files Browse the repository at this point in the history
  • Loading branch information
joanjpx committed Aug 23, 2019
1 parent f2e5108 commit 4670272
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
2 changes: 1 addition & 1 deletion 2_dataTypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
tuple = (1,2,3,4,5,6);
print(type(tuple));

#DICTORIONIES
# DICTIONARIES
d = {
"name":"Joan",
"lastName":"Perez",
Expand Down
17 changes: 14 additions & 3 deletions 3_variables.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
## VARIABLES
nombre = "Joan";
name = "Joan";

## Case Sensitive
Book = "Digital Fortress";
book = "Dr. Jekyll & Mr. Hyde";

# List Var Assignment
index,_serie = 1, "Mr. Robot";

#nombre = "Johan";

print(book)
print(index,_serie)
print(nombre);
print(name);


## CONVENTIONS
book_name = "Fight Club"; #Snake Case
bookName = "Secret Window"; #Camel Case
BookName = "The Analyst"; #Pascal Case
BookName = "The Analyst"; #Pascal Case


# CONSTANTS ( UPPERCASE VAR NAME )
LIBRO = "Steve Jobs By Walter Isaacson";
PI = 3.1416;

print(PI)
13 changes: 13 additions & 0 deletions 4_strings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## STRINGS
myString = "hello world";

## Dir para saber lo que se puede hacer con un string // Get Strings Functions

#print(dir(myString));
print(myString.upper());
print(myString.lower());
print(myString.swapcase());
print(myString.capitalize());

## CHAINED METHODS
print(myString.replace('hello','bye').upper());

0 comments on commit 4670272

Please sign in to comment.