1.3.5: Strings
For this assignment, we were required to create a program that would check if a tweet satisfied all the requirements that were previously set out. The tweet needed to to be less than 140 characters and contain a question mark, comma, double quote, and exclamation mark.
Conclusion:
1: The sentence has 41 characters (including spaces), and it makes no difference whether the characters are stored
2: The outcome of the code is "d an" because of the assigned variables and the way in which they are switched around,as you can see in the code below.
In []: a = 'one string'
In []: b = 'another'
In []: c = a[:3] + ' and ' + b
In []: print(c[6:10])
No comments:
Post a Comment