#Sam Ola
#10/11/2021
#In this lesson i learned how to use backlash
#i had trouble with task 2 so i couldn't finish it
# review and run example using \n (new line)
print('Hello World!\nI am formatting print ')
Hello World!
I am formatting print
# review and run code using \t (tab)
student_age = 17
student_name = "Hiroto Yamaguchi"
print("STUDENT NAME\t\tAGE")
print(student_name,'\t' + str(student_age))
STUDENT NAME AGE
Hiroto Yamaguchi 17
# review and run code
# using \" and \' (escaped quotes)
print("\"quotes in quotes\"")
print("I\'ve said \"save your notebook,\" so let\'s do it!")
# using \\ (escaped backslash)
print("for a newline use \\n")
"quotes in quotes"
I've said "save your notebook," so let's do it!
for a newline use \n
print("\\WARNING!///")
\WARNING!///
print("\"What's that?\" isn\'t a specific question.")
"What's that?" isn't a specific question.
print("One Two Three\nFour Five Six")
One Two Three
Four Five Six
#[ ] create and test pre_word()
pre_word = "pre"
if pre_word.alpha().startswith("pre"):
print("True")
else:
print("False")
input("enter a word that starts with \"pre\"")
Execution Error
AttributeError: 'str' object has no attribute 'alpha'
# [ ] review, run, fix comment your fixes
print("Hello\nWorld!")
Hello
World!