![]() Create another directory inside python101 named Chapter-03 to store the source files for this chapter. Then, use the Python interpreter in script mode to execute the code from a file.Ĭreate a new directory named python101, you can create this directory anywhere you want, just remember the location because we will use this directory to store all our programs throughout this course. In case, you want to execute same set of statements multiple times you would be better off to save the entire code in a file. Python Shell is great for testing small chunks of code but there is one problem - the statements you enter in the Python shell are not saved anywhere. To quit the Python shell in Windows hit Ctrl+Z followed by the Enter Key, On Linux or Mac hit Ctrl+D followed by Enter key. A program usually consists of sequence of statements. Statements are of different types as we will see. ![]() A statement is simply a instruction for the Python interpreter to execute. In upcoming lessons we will discuss these concepts in great detail.Ĭommands such as 17 / 3, print("Big Python") are know as statements in programming. For example: "olleh", 'print it' are strings but 1 and 3 are not.ĭon't worry, we are not expecting you understand these things at this point. ![]() In our case, the print() function prints the argument (i.e "Big Python") it is given to the console.Ī string is just a sequence of string enclosed inside single or double quotes. Print() is a function - A function in programming is a chuck of code which does something very specific. We have just used two important programming constructs - A function and a string. ![]() Python Dictionaries Access Items Change Items Add Items Remove Items Loop Dictionaries Copy Dictionaries Nested Dictionaries Dictionary Methods Dictionary Exercise Python If.Else Python While Loops Python For Loops Python Functions Python Lambda Python Arrays Python Classes/Objects Python Inheritance Python Iterators Python Scope Python Modules Python Dates Python Math Python JSON Python RegEx Python PIP Python Try.> print ( "Big Python" ) Big Python > ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |