ENGINEER 1D04 Chapter Notes - Chapter 4: Negative Number, Eval, Gnu Readline

37 views4 pages
scarletotter976 and 37168 others unlocked
ENGINEER 1D04 Full Course Notes
4
ENGINEER 1D04 Full Course Notes
Verified Note
4 documents

Document Summary

Text is presented in python as string data type. A string is formed by enclosing some characters in quotation marks. Python could read strings if they were enclosed with either single quotation marks ( ") or double( ) . If you need to get textual input from the user, raw_input should be used instead of input. String is a sequence of characters, to get access to the individual characters that make up the string the operation of indexing needs to be used. When counting the number of characters in a string we always start from zero as the first one, space is also counted as a character. Therefore, the string hello bob , contains 8 characters or elements. In the example the string is assigned to a variable x, therefore using the string itself or the variable when indexing is the same thing. If negative number is used python with count from right to left starting from -1.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents