Question
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
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