-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
266d6af
commit f15b966
Showing
4 changed files
with
53 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,3 @@ | ||
class Dog(): | ||
def __init__(self, name, age): | ||
self.name = name | ||
self.age = age | ||
|
||
def sit(self): | ||
print(f"{self.name.title()} \ | ||
is now sitting.") | ||
|
||
def roll_over(self): | ||
print(f"{self.name.title()} \ | ||
rolled over!") | ||
|
||
|
||
my_dog = Dog('willie', 6) | ||
|
||
print(my_dog.name.title()) | ||
print(str(my_dog.age) + " years old") | ||
class Dog(list): | ||
pass | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
I love programming. | ||
I love creating new games. | ||
I love |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
filename = 'alice.txt' | ||
try: | ||
with open(filename) as f_obj: | ||
contents = f_obj.read() | ||
except FileNotFoundError: | ||
msg = f"Sorry, the file {filename} does not exist." | ||
print(msg) | ||
filename = 'programming.txt' | ||
with open(filename, 'w') as file_object: | ||
file_object.write("I love programming.\n") | ||
file_object.write("I love creating new games.\n") | ||
|
||
|
||
with open(filename, 'a') as file_object: | ||
file_object.write("I love") |
f15b966
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
workstation – ./
workstation-wangwanglulu.vercel.app
workstation-drab.vercel.app
www.wangwanglulu.com
workstation-git-gh-pages-wangwanglulu.vercel.app
wangwanglulu.com