Download presentation
Presentation is loading. Please wait.
Published by僧贝 郑 Modified over 5 years ago
1
Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg
Exam Prep and Wrap-Up Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg
2
Topics for today Information on the exams
Several examples from your book Some string formatting examples
3
Exam Information Two exams Focuses on chapters 0-4
Includes material from the lectures (also in the readings), labs, and homeworks
4
Exam Information Wednesday Sabin 102 Normal class time (11:00-11:50am)
Mixture of multiple choice, short answer, and essay. 100 points Closed book, closed notes Computerized exam
5
Exam Information Thursday In lab (WRT 112), programming exam
Five small scripts 125 points (25 points each) Closed book May use the IDLE built in Python documentation (really not helpful if you haven’t used it before then)
6
Advice for the Tests These things can make the difference of whether you pass or fail this class when studying Go through each class days notes and example programs on the website Practice coding over and over by going through your labs!!! This is the only way to really learn. Review vocabulary and concepts by reading the book!!
7
Again… The only way you can become comfortable with a toolset is to practice Understanding what a power drill does will not help you much if you don’t practice using it It’s the same for code Practicing coding will make you more familiar with the coding structures necessary to code more quickly Patterns will emerge, it will become easier
8
Review Wrap-Up Find a Letter Error Checking Nested Loops
DeMorgan’s Law Using and/or/not correctly
9
Example Problem Can you write a program that
Prompts for a string and a letter Searches that string for a letter (without using the .find() method!) Prints a message saying in which index position the letter was found or that the letter was not found
10
4.1 Find a Letter string = input('Enter string: ') target = input('Input character to find: ') found = False for index in range(len(string)): #for each index if string[index] == target: #check print( "Letter found at index: ", index ) found = True break # stop searching if (found == False) print( 'Letter',target,'not found in',string)
11
Examples [Look at example code linked on today’s class webpage]
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.