Question: PLZ answer asap I will upvote! COMP 2067 Lab 3 OBJECTIVES: i. To explore str data types and its built-in methods in detail ii. To

PLZ answer asap I will upvote!

PLZ answer asap I will upvote! COMP 2067 Lab 3 OBJECTIVES: i.

COMP 2067 Lab 3 OBJECTIVES: i. To explore str data types and its built-in methods in detail ii. To accept user input entered through the keyboard 1. Write a Python program (with comments) to do the following: a. Assign the value '30//6' to a variable str1. b. Use the eval() function to evaluate strland assign the result to a variable numl. Print numl with a suitable message. c. Ask the user to input their favorite city in lowercase and save the response in a variable city. Print city with a suitable message. d. Determine the first letter of city assign it to a variable x and display it with a suitable message. e. Determine the ASCII code for the first letter of city and display it with a suitable message. HINT: Use the built-in ord() function. See pg. 78-79 of textbook. f. Determine how many times x (i.e. 1st letter of city) occurs in city and display the result with a suitable message. g. Print the first 4 letters of city in uppercase. The letters should be centered in a string of length 30, with "*' as the fill character for the remaining positions. HINT: Use built-in str.center() method. 2. Save your code to a file with name lab3sol.py. 3. Submit your Python code (i.e. lab3sol.py file) through BB

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!