Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This is for python thank you vey much. would be better if you can give me the code to copy Laboratory 1 1. Strings Python
This is for python thank you vey much. would be better if you can give me the code to copy
Laboratory 1 1. Strings Python strings are delimited by the single or the double quotation mark. If you use three double quotation marks as delimiters before and after the string, then the string can contain line breaks. In this exercise, we just use several print statements to print out one line at a time. Recall that a backslash followed by many other characters has a special meaning. We say that the backslash is an escape character and that the symbol itself has been escaped. If you want to put a quotation mark inside a string delimited by the same quotation mark, then you need to use the backslash. While Python is very good at divining your intention (or rather has a clever algorithm to understand strings), you sometimes need to escape the backslash itself in order for it to be represented. As a rule of thumb, when you want a backslash, always escape it by doubling it. '-_Y_/-' 1.1 Your first task is to draw the bear's face on the right with seven print statements. (The long horizontal lines are underscores.) The second print statement is something like 1.2 Your second task is to write the following pattern using 5 print statements. hih There is a tab character after each "hi". The first line could be hi hi i hi hi hi hi hi hi hi hi hi hi hi hi hi hi hi hi print ("hilt" 2) 1.3 Use string concatenation (with the plus (+)operator) to write 5 lines of text on the right where there are two, three, four, five, and six tab:s between the "hi". The first line is generated by hi hi hi print ("hi+2*"\t"+"hi") 2.Processing Input Recall that Python uses the input function in order to obtain input from the keyboard. Using the following Furlong to Meters program as a paradigm, create programs that convert Cables to Meters, Acres to Square Meters, Gallons to Liters, Degrees Celsius to Degree Fahrenheit, and Degrees Fahrenheit to Degrees Celsius. furlongsfloat (input ("Enter distance in Furlongs: ")) print ('The distance is', furlongs 201.168, 'meters.') Laboratory 1 1. Strings Python strings are delimited by the single or the double quotation mark. If you use three double quotation marks as delimiters before and after the string, then the string can contain line breaks. In this exercise, we just use several print statements to print out one line at a time. Recall that a backslash followed by many other characters has a special meaning. We say that the backslash is an escape character and that the symbol itself has been escaped. If you want to put a quotation mark inside a string delimited by the same quotation mark, then you need to use the backslash. While Python is very good at divining your intention (or rather has a clever algorithm to understand strings), you sometimes need to escape the backslash itself in order for it to be represented. As a rule of thumb, when you want a backslash, always escape it by doubling it. '-_Y_/-' 1.1 Your first task is to draw the bear's face on the right with seven print statements. (The long horizontal lines are underscores.) The second print statement is something like 1.2 Your second task is to write the following pattern using 5 print statements. hih There is a tab character after each "hi". The first line could be hi hi i hi hi hi hi hi hi hi hi hi hi hi hi hi hi hi hi print ("hilt" 2) 1.3 Use string concatenation (with the plus (+)operator) to write 5 lines of text on the right where there are two, three, four, five, and six tab:s between the "hi". The first line is generated by hi hi hi print ("hi+2*"\t"+"hi") 2.Processing Input Recall that Python uses the input function in order to obtain input from the keyboard. Using the following Furlong to Meters program as a paradigm, create programs that convert Cables to Meters, Acres to Square Meters, Gallons to Liters, Degrees Celsius to Degree Fahrenheit, and Degrees Fahrenheit to Degrees Celsius. furlongsfloat (input ("Enter distance in Furlongs: ")) print ('The distance is', furlongs 201.168, 'meters.')Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started