string functions isspace() – used to check the string is space x= “ "

Slides:



Advertisements
Similar presentations
1. Write an Excel text function in cell Company Data!A4, which may be copied down, to string together the first and last name with only the first letter.
Advertisements

Computer Science & Engineering 2111 Text Functions 1CSE 2111 Lecture-Text Functions.
Chapter 7. Even in quantitative sciences, we often encounter letters and/or words that must be processed by code You may want to write code that: Reads.
ECS15 for and sequence. Comments  Another way to repeat.
1 Python Chapter 3 Reading strings and printing. © Samuel Marateck.
Strings. Strings are amongst the most popular types in Python. We can create them simply by enclosing characters in quotes. Python treats single quotes.
$2 $5 $10 $20 $1 $2 $5 $10 $20 $1 $2 $5 $10 $20 $1 $2 $5 $10 $20 $1 $2 $5 $10 $20 $1 Library Terms Books Computer Terms Genres Places in the Library.
CS0004: Introduction to Programming Relational Operators, Logical Operators, and If Statements.
Noadswood Science,  To understand what strings are and how decisions are made Thursday, September 17, 2015.
Lists and More About Strings CS303E: Elements of Computers and Programming.
© Copyright 2012 by Pearson Education, Inc. All Rights Reserved. Chapter 8 More on Strings and Special Methods 1.
Computer Science: A Structured Programming Approach Using C A Programming Example— Morse Code Morse code, patented by Samuel F. B. Morse in 1837,
Introduction to Java Thanks to Dan Lunney (SHS). Java Basics File names The “main” method Output to screen Escape Sequence – Special Characters format()
Python for Informatics: Exploring Information
1 Data Comparisons and Switch Data Comparisons Switch Reading for this class: L&L 5.3,
CSC 107 – Programming For Science. Announcements  Lectures may not cover all material from book  Material that is most difficult or challenging is focus.
Characters. Character Data char data type – Represents one character – char literals indicated with ' '
Representing Characters in a computer Pressing a key on the computer a code is generated that the computer can convert into a symbol for displaying or.
1 CSC 221: Introduction to Programming Fall 2011 Lists  lists as sequences  list operations +, *, len, indexing, slicing, for-in, in  example: dice.
More Strings CS303E: Elements of Computers and Programming.
Using MLA form.  Collect information from all sources.  See MLA guide on Website for most common sources.  Generally the author’s last name is the.
Writing Essays. Heading Top left corner of the page Your name English I Period ___ McConnell Date A creative title should be centered over the paper.
Notes on Python Regular Expressions and parser generators (by D. Parson) These are the Python supplements to the author’s slides for Chapter 1 and Section.
Introduction to Computer Organization & Systems Topics: Types in C: floating point COMP C Part III.
Lecture # 15. Mealy machine A Mealy machine consists of the following 1. A finite set of states q 0, q 1, q 2, … where q 0 is the initial state. 2. An.
Starter – Its the small things in life What’s wrong with this code Height = 10 Width = 10 A = Height * Width Print A Remember to check: Spelling Spacing.
This is your Title Slide Name & Class Period Title of Project At least 1 topic related picture.
More String Manipulation. Programming Challenge Define a function that accepts two arguments: a string literal and a single character. Have the function.
Strings CSE 1310 – Introduction to Computers and Programming Alexandra Stefan University of Texas at Arlington 1.
DAY 3. ADVANCED PYTHON PRACTICE SANGREA SHIM TAEYOUNG LEE.
Nested Loops CS303E: Elements of Computers and Programming.
Parallel embedded system design lab 이청용 Chapter 2 (2.6~2.7)
Introduction to programming in java
Logical Functions Excel Lesson 10.
String Methods Programming Guides.
Notes on Python Regular Expressions and parser generators (by D
CS 240 – Computer Programming I Lab
Introduction to Computer Science / Procedural – 67130
String Processing Upsorn Praphamontripong CS 1110
Strings Part 1 Taken from notes by Dr. Neil Moore
Keyboarding True or false
Binary Files.
String Manipulation Part 2
String Encodings and Penny Math
Chapter 8 More on Strings and Special Methods
Chapter 8 More on Strings and Special Methods
Python - Strings.
Manipulating Text In today’s lesson we will look at:
Topics discussed in this section:
String Manipulation Chapter 7 Attaway MATLAB 4E.
Chapter 8 More on Strings and Special Methods
© A+ Computer Science - What is a LOOP? © A+ Computer Science -
Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg
Python for Informatics: Exploring Information
Class Examples.
Variables Kevin Harville.
Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg
LING 408/508: Computational Techniques for Linguists
CS 1111 Introduction to Programming Spring 2019
590 Scraping – NER shape features
Introduction to Computer Science
GCSE COMPUTER SCIENCE Topic 3 - Data 3.4 Hexadecimal Conversion.
Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg
Introduction to Computer Science
String Encodings and Penny Math
Welcome back! October 11, 2018.
Formatting Output.
Strings Taken from notes by Dr. Neil Moore & Dr. Debby Keen
Pre-AP® Computer Science Quiz
Introduction to Computer Science
Presentation transcript:

Topic- String functions – isspace(),istitle(),lstrip(),rstrip(), capitalize()

string functions isspace() – used to check the string is space x= “ " print x.isspace() ->True istitle() – check whether the string is in title case x= “I Like Computer“ print x.istitle() ->True

string functions lstrip() – removes extra space from left. x= “ book " print x.lstrip() OUTPUT book rstrip() – removes extra space from right. x= “ book " print x.rstrip()

string functions lstrip(CHAR) – removes particular character from left. x= “ xxbookxx" print x.lstrip(‘x’) OUTPUT bookxx rstrip(CHAR) – removes particular character from right. x= “ xxbookxx“ print x.rstrip(‘x’) xxbook

string functions lstrip(string ) x= “ there" print x.lstrip(‘ht’) rstrip(string ) print x.rstrip(‘er’)

string functions capitalize() – converts the first letter to upper case. x= “computer science " print x.capitalize() OUTPUT Computer science