Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please do not copy others. Thank you Working with data types, boolean expressions & making decisions. Create one .py source file for each task. Tasks

Please do not copy others. Thank you

Working with data types, boolean expressions & making decisions.

Create one .py source file for each task.

Tasks

Task 1

1) Create 4 variables with four distinct data types and values

2) Output each variable using one output statement

Task 2

1) Ask the user for 3 text values

2) Determine which text is the longest

a) Output both the length and the value of the longest text (1 mark)

i) Hint: There are 7 possibilities

Task 3

1) Ask the user for input. (1 mark)

2) Determine if the user input is a number

a) If so,

i) Typecast the input to a numerical data type.

ii) Output the number

b) If not,

i) Output the number of characters of the user input

Task 4

1) Ask user for input

2) Using one IF statement block

a) Determine if input is

i) a string greater than 3 characters

(1) Display a message stating that the string is greater than 3 characters

ii) an empty string

(1) Display a message stating that the string is empty

b) If neither of the above cases are true, display a message thanking the user for input.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Demystifying Databases A Hands On Guide For Database Management

Authors: Shiva Sukula

1st Edition

8170005345, 978-8170005346

More Books

Students also viewed these Databases questions