1 00:00:00,000 --> 00:00:02,228 Okay, so you know strings, you know 2 00:00:02,229 --> 00:00:04,698 floats, you know integers, you know lists. 3 00:00:04,699 --> 00:00:07,028 Okay, so you know data types, but how 4 00:00:07,029 --> 00:00:09,642 can you actually do something in Python? 5 00:00:09,643 --> 00:00:12,250 What can you do with these data types? 6 00:00:12,251 --> 00:00:13,988 Well, to answer your question, you 7 00:00:13,989 --> 00:00:19,010 should look at the dir command. 8 00:00:19,011 --> 00:00:21,962 But let me now start to use the Python 9 00:00:21,963 --> 00:00:25,556 shell a little bit more to do things quick. 10 00:00:25,557 --> 00:00:28,460 So I'm going to split this into two. 11 00:00:28,461 --> 00:00:31,858 This is for executing the Python file. 12 00:00:31,859 --> 00:00:35,458 This is for the Interactive Python Shell. 13 00:00:35,459 --> 00:00:37,984 So what can we do with list? 14 00:00:37,985 --> 00:00:40,358 You can find that out by doing dir. 15 00:00:40,359 --> 00:00:44,460 dir is a function in Python that will give you 16 00:00:44,461 --> 00:00:48,033 [No audio] 17 00:00:48,033 --> 00:00:52,452 all the things you can do with a specific type. 18 00:00:52,453 --> 00:00:54,980 So with a list, in this case, 19 00:00:54,981 --> 00:00:58,720 all this here are attributes of list. 20 00:01:00,370 --> 00:01:03,460 You can do the same for checking int. 21 00:01:03,461 --> 00:01:05,766 [No audio] 22 00:01:05,766 --> 00:01:08,030 You can do the same for checking floats. 23 00:01:08,031 --> 00:01:10,900 dir float, dir str. 24 00:01:10,901 --> 00:01:12,866 [No audio] 25 00:01:12,870 --> 00:01:17,452 For example, let's do it with str before we go to list. 26 00:01:17,453 --> 00:01:21,548 With strings you can do for example, you 27 00:01:21,549 --> 00:01:25,350 can turn them into uppercase using these methods. 28 00:01:25,930 --> 00:01:33,068 To find out what upper does, you want to use help(str), 29 00:01:33,069 --> 00:01:36,570 that is a type that has the attribute upper. 30 00:01:37,150 --> 00:01:40,308 Now attributes are all these and they 31 00:01:40,309 --> 00:01:43,418 can be either methods or properties. 32 00:01:43,419 --> 00:01:46,880 You don't know that until you check with help. 33 00:01:46,881 --> 00:01:51,866 [No audio] 34 00:01:51,866 --> 00:01:56,742 So that is a help documentation for the upper method. 35 00:01:56,743 --> 00:01:59,440 It's a method as you can see here. q 36 00:01:59,441 --> 00:02:03,450 to quit and go back to the shell, 37 00:02:04,110 --> 00:02:06,784 and then let's go ahead and use that. 38 00:02:06,785 --> 00:02:09,310 "hello".upper(). 39 00:02:09,970 --> 00:02:15,550 You use a method with round brackets with parentheses 40 00:02:16,290 --> 00:02:20,480 and that will return the capitalized version of hello. 41 00:02:21,010 --> 00:02:25,972 If we used title instead, that 42 00:02:25,973 --> 00:02:28,770 will capitalize the first letter only. 43 00:02:28,771 --> 00:02:32,433 Of course, you can use variables, 44 00:02:32,434 --> 00:02:38,966 [Author typing] 45 00:02:38,970 --> 00:02:40,802 and you get the same output. 46 00:02:40,803 --> 00:02:43,830 Now, what do we have for lists? 47 00:02:44,570 --> 00:02:46,946 How about calculating the average 48 00:02:46,947 --> 00:02:48,882 of the student_grades? 49 00:02:48,883 --> 00:02:50,680 Let's do that in the next video. 50 00:02:50,681 --> 00:02:54,033 [Outro sound]