- #1
jkoster09
- 15
- 0
I had a brief stint with Python a year or two ago, and after I learned of the Raspberry Pi I knew I should try to learn again. I purchased this book, knowing full well that the online resources would be sufficient, and some of the code doesn't seem to work.
hello_str = "Hello World"
hello_bool = True
hello_truple = (21, 32)
hello_list = ("Hello,","this","is","a","list")
hello_list = list()
hello_list.append("Hello,")
hello_list.apppend("this")
hello_list.append("is")
hello_list.append("a")
hello_list.append("list")
hello_dict = {"first_name":"*My First Name*",
"last_name":"*My Last Name",
"eye_color":"*My Eye Color*"}
print(hello_list[4])
hello_list[4]+="!"
This is the code copied verbatim from the book. It gets an error at the part with multiple append commands, but even when I comment that out it also hangs on the final line. What am I missing here? If it's any help, the book is simply titled "The Python Book: The ultimate guide to coding with Python". It says it's written for 2.x, but I tried 3 just to be sure. No luck.
hello_str = "Hello World"
hello_bool = True
hello_truple = (21, 32)
hello_list = ("Hello,","this","is","a","list")
hello_list = list()
hello_list.append("Hello,")
hello_list.apppend("this")
hello_list.append("is")
hello_list.append("a")
hello_list.append("list")
hello_dict = {"first_name":"*My First Name*",
"last_name":"*My Last Name",
"eye_color":"*My Eye Color*"}
print(hello_list[4])
hello_list[4]+="!"
This is the code copied verbatim from the book. It gets an error at the part with multiple append commands, but even when I comment that out it also hangs on the final line. What am I missing here? If it's any help, the book is simply titled "The Python Book: The ultimate guide to coding with Python". It says it's written for 2.x, but I tried 3 just to be sure. No luck.