print("Hello World!")

You should use different types of quotation, depending on what your work requires. Single quotation marks are only useful if you do not need to use any other single quotation marks in your quote that is in the quotations. Double quotation marks are good if you need to use single quotation marks in the quote. There are two types of triple quotation- triple single quotation marks, '''''', and """ """. These triple quotation marks are good if you want to create a very long string containing a long quote. Keep in mind that you cannot return the line where you are defining the string, otherwise there will be a syntax error, since you are not defining anything for that variable anymore. You can return as many lines as you want in the string however, just not the first line where you are defining the actual quotation/string.

Sets are unordered and unindexed datatypes that store values that are not duplicates. This makes sets especially useful when you need to print a list or string without any duplicate values, since sets automatically filter them out, so all you need to do is just convert whatever you want to filter to a set.

ipython is a good testing environment when you want to simply test a simple code, since it cannot save anything, which means it is not efficient for actually writing code that you would like to save, rather just to test new code that you have written.

List slicing is basically just when you want to print out something in a certain index range. You enter a start index, a stop index, and optionally, a step interval, which means how many indexes are you counting by each time.

Any time you divide in python, the default format or datatype that it converts the numbers that you are dividing by, is float., however if you use the double slash division operator, //, it will convert the datatype of the numbers that you are dividing to int, since the double slash division operator means that you are rounding to a whole number, or whole number division, which means that it no longer classifies the numbers that you are defining to a float datatype. You can

AI悦创·推出辅导班啦,包括「Python 语言辅导班、C++辅导班、算法/数据结构辅导班、少儿编程、pygame 游戏开发」,全部都是一对一教学:一对一辅导 + 一对一答疑 + 布置作业 + 项目实践等。QQ、微信在线,随时响应!V:Jiabcdefh
AI悦创 » Python Lesson 1 Homework