Introduction to Computer Science with Prof. Rodger
This course covers various topics in computer science such as programming, algorithms, and data structures. Students will explore hands-on assignments, readings, and labs to enhance their understanding of the subject. The course also delves into topics like working with strings, loops, and building basic shapes using programming. Follow along with announcements, assignments, and examples as you progress through the exciting world of computer science.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
CompSci 101 Introduction to Computer Science January 27, 2015 Prof. Rodger
Announcements Reading, RQ 06 next time Assign 2 due today, Assign 3 out APT 2 is due on Thursday Lab 3 this week Finish working on APT Pancakes compsci101 spring 2015 2
APT Pancakes.(cont) compsci101 spring 2015 3
Turtles bit.ly/101S15-0127-01 Run in eclipse Make square with different sizes? Make a rectangle? Where is the repetition? New commands: up(), down(), position(), goto() compsci101 spring 2015 4
Assignment 3 Draw a picture compsci101 spring 2015 5
Computer Science Alum Biology and CS Undergraduate Research - JFLAP Epic Now in Med School at Vanderbilt compsci101 spring 2015 6
More Computer Science Duke Alums compsci101 spring 2015 7
More on Strings Strings are indexed starting at 0 Example: word w o r d 0 1 2 3 Use [num] to refer to a particular character in word Use [x:y] to refer to a slice of the string starting at position x and up to but not including position y. Can leave out x or y. compsci101 spring 2015 8
Examples phrase = "Duke Blue Devils" print phrase[0] print phrase[-3] print phrase[1:3] print phrase[5:10] + phrase[:4] print (phrase[phrase.find('ev'):]).upper() String fun Crazy import compsci101 spring 2015 9
Loop over all characters in a String compsci101 spring 2015 10
Loop over string Online form: www.bit.ly/101S15-0127-02 compsci101 spring 2015 11
Loop over all words in a list compsci101 spring 2015 12
Loop over words Online form: www.bit.ly/101S15-0127-03 compsci101 spring 2015 13
APT Emphasize bit.ly/101S15-0127-04 compsci101 spring 2015 14