Subjects

Subjects

Companies

variables and data types python

3

Share

Save


Activity 3.2.1
Where does the name 'Boolean' come from?
Boolean variables are named after George Boole who invented the mathematics of digit

Sign up

Sign up to get unlimited access to thousands of study materials. It's free!

Access to all documents

Join milions of students

Improve your grades

By signing up you accept Terms of Service and Privacy Policy

Activity 3.2.1
Where does the name 'Boolean' come from?
Boolean variables are named after George Boole who invented the mathematics of digit

Sign up

Sign up to get unlimited access to thousands of study materials. It's free!

Access to all documents

Join milions of students

Improve your grades

By signing up you accept Terms of Service and Privacy Policy

Activity 3.2.1
Where does the name 'Boolean' come from?
Boolean variables are named after George Boole who invented the mathematics of digit

Sign up

Sign up to get unlimited access to thousands of study materials. It's free!

Access to all documents

Join milions of students

Improve your grades

By signing up you accept Terms of Service and Privacy Policy

Activity 3.2.1 Where does the name 'Boolean' come from? Boolean variables are named after George Boole who invented the mathematics of digital logic. Find a picture of George Boole and insert it here. ● When was he born? 2 November 1815 3.2 Variables and Data Types Activity 3.2.2 Data types Use the 'type' function to find out the data types for these values: ● >>>type("Fred") >>>type(198) int >>>type(88.9) float >>>type(True) bool >>>type(False) bool Hint: Remember that True and False must start with a capital letter. Activity 3.2.3 Expression "hello world" False 15 35.6 -999 "15" "False" True 0.001 The type function returns the data type of an expression. For each of these expressions, first predict the data type then use the type command to see if your prediction was correct. ● str Predicted data type string boolean integer float integer string string boolean float Activity 3.2.4 The interactive shell is a useful place to explore variables. Copy and run this code in the interactive shell: myName="Fred Smith" myAge=14 print(myName, myAge) Fred Smith 14 Type command type("hello world") type(False) type(15) type(35.6) type(-999) type("15") type("False") type(True) type(0.001) Result string boolean integer float integer string string boolean float Create a variable called myName and assign it to your name. myName="Lilac Osborne" Create a variable called myAge and assign it to your age myAge=15 Create a variable called myEyes and assign it to your eye colour. myEyes="brown" ● Create a variable called myHeight and assign it to your height. MyHeight="5'8\"" Write the commands to display on the screen your name, age, eye colour height. myName="Lilac Osborne" my Age=15 myEyes="brown" myHeight="5'8\"" print(myName,myAge,my Eyes, myHeight) Hint: Remember that a single '=' is used to assign a value to a variable. Activity 3.2.5 Variable...

Can't find what you're looking for? Explore other subjects.

Knowunity is the # 1 ranked education app in five European countries

Knowunity is the # 1 ranked education app in five European countries

Knowunity was a featured story by Apple and has consistently topped the app store charts within the education category in Germany, Italy, Poland, Switzerland and United Kingdom. Join Knowunity today and help millions of students around the world.

Ranked #1 Education App

Download in

Google Play

Download in

App Store

Still not sure? Look at what your fellow peers are saying...

iOS User

I love this app so much [...] I recommend Knowunity to everyone!!! I went from a C to an A with it :D

Stefan S, iOS User

The application is very simple and well designed. So far I have found what I was looking for :D

SuSSan, iOS User

Love this App ❤️, I use it basically all the time whenever I'm studying

Alternative transcript:

names A programmer is trying to decide on a valid name for a variable that represents a house number. Which of the following variable assignments are valid? Why are the others not valid? Reason why not valid 8HouseNumber = 288 houseNumber = 288 house Number = 288 house_number = 288 import = 288 Valid or invalid variable name? invalid Valid invalid Valid invalid Starts with a number Space between the words Import is a built in function What type of error do you get when using an invalid variable name? Invalid syntax Activity 3.2.6 Copy and run this code and explain the result: # Programmer Amy Jones 12/8/2013 # adds two numbers Activity 3.2.7 Data types in Python Complete this table to describe the four data types. Data type Python Explanation abbreviation string numberOne=15 numberTwo=23 answer=numberOne + numberTwo print("The answer is ",answer) integer float boolean int str float bool A whole number Sequence of characters that cannot be changed Numbers with decimal points True False Example (100) ("hello") 18.0 True Hint: Quotation marks are used to show the start and end point of a string, e.g. "this is a string".

variables and data types python

3

Share

Save

Computer Science

 

10/11

Revision note

user profile picture

Los

160 Followers

Comments (1)

Activity 3.2.1
Where does the name 'Boolean' come from?
Boolean variables are named after George Boole who invented the mathematics of digit
Activity 3.2.1
Where does the name 'Boolean' come from?
Boolean variables are named after George Boole who invented the mathematics of digit
Activity 3.2.1
Where does the name 'Boolean' come from?
Boolean variables are named after George Boole who invented the mathematics of digit

computer science worksheet with answers python

Similar Content

0

variables and data types python - Flashcards

Know Python Basics 1 thumbnail

4

Python Basics 1

Print statements,data types,comments,variables (will be doing more soon !!)

Know Computer Science - Programming Key Terms thumbnail

0

Computer Science - Programming Key Terms

Y8 - Computer Science Programming Key Terms

Know Guide to python coding - Basics and If statements thumbnail

43

Guide to python coding - Basics and If statements

This guide and summary of python will allow you to understand the basics of python coding and allow you to do basic coding which you can then develop into advanced coding

Know GCSE CS Component 2 revision notes  thumbnail

4

GCSE CS Component 2 revision notes

Learn about Bubble, Insertion, and Merge sort algorithms, their advantages, disadvantages, and examples. Understand how each sort works for exam preparation.

Know Software Design and Development Notes thumbnail

0

Software Design and Development Notes

notes for everything we need to know for the nat 5 computing science exam in the software section(from achieve and from my class notes)

Activity 3.2.1 Where does the name 'Boolean' come from? Boolean variables are named after George Boole who invented the mathematics of digital logic. Find a picture of George Boole and insert it here. ● When was he born? 2 November 1815 3.2 Variables and Data Types Activity 3.2.2 Data types Use the 'type' function to find out the data types for these values: ● >>>type("Fred") >>>type(198) int >>>type(88.9) float >>>type(True) bool >>>type(False) bool Hint: Remember that True and False must start with a capital letter. Activity 3.2.3 Expression "hello world" False 15 35.6 -999 "15" "False" True 0.001 The type function returns the data type of an expression. For each of these expressions, first predict the data type then use the type command to see if your prediction was correct. ● str Predicted data type string boolean integer float integer string string boolean float Activity 3.2.4 The interactive shell is a useful place to explore variables. Copy and run this code in the interactive shell: myName="Fred Smith" myAge=14 print(myName, myAge) Fred Smith 14 Type command type("hello world") type(False) type(15) type(35.6) type(-999) type("15") type("False") type(True) type(0.001) Result string boolean integer float integer string string boolean float Create a variable called myName and assign it to your name. myName="Lilac Osborne" Create a variable called myAge and assign it to your age myAge=15 Create a variable called myEyes and assign it to your eye colour. myEyes="brown" ● Create a variable called myHeight and assign it to your height. MyHeight="5'8\"" Write the commands to display on the screen your name, age, eye colour height. myName="Lilac Osborne" my Age=15 myEyes="brown" myHeight="5'8\"" print(myName,myAge,my Eyes, myHeight) Hint: Remember that a single '=' is used to assign a value to a variable. Activity 3.2.5 Variable...

Activity 3.2.1 Where does the name 'Boolean' come from? Boolean variables are named after George Boole who invented the mathematics of digital logic. Find a picture of George Boole and insert it here. ● When was he born? 2 November 1815 3.2 Variables and Data Types Activity 3.2.2 Data types Use the 'type' function to find out the data types for these values: ● >>>type("Fred") >>>type(198) int >>>type(88.9) float >>>type(True) bool >>>type(False) bool Hint: Remember that True and False must start with a capital letter. Activity 3.2.3 Expression "hello world" False 15 35.6 -999 "15" "False" True 0.001 The type function returns the data type of an expression. For each of these expressions, first predict the data type then use the type command to see if your prediction was correct. ● str Predicted data type string boolean integer float integer string string boolean float Activity 3.2.4 The interactive shell is a useful place to explore variables. Copy and run this code in the interactive shell: myName="Fred Smith" myAge=14 print(myName, myAge) Fred Smith 14 Type command type("hello world") type(False) type(15) type(35.6) type(-999) type("15") type("False") type(True) type(0.001) Result string boolean integer float integer string string boolean float Create a variable called myName and assign it to your name. myName="Lilac Osborne" Create a variable called myAge and assign it to your age myAge=15 Create a variable called myEyes and assign it to your eye colour. myEyes="brown" ● Create a variable called myHeight and assign it to your height. MyHeight="5'8\"" Write the commands to display on the screen your name, age, eye colour height. myName="Lilac Osborne" my Age=15 myEyes="brown" myHeight="5'8\"" print(myName,myAge,my Eyes, myHeight) Hint: Remember that a single '=' is used to assign a value to a variable. Activity 3.2.5 Variable...

Can't find what you're looking for? Explore other subjects.

Knowunity is the # 1 ranked education app in five European countries

Knowunity is the # 1 ranked education app in five European countries

Knowunity was a featured story by Apple and has consistently topped the app store charts within the education category in Germany, Italy, Poland, Switzerland and United Kingdom. Join Knowunity today and help millions of students around the world.

Ranked #1 Education App

Download in

Google Play

Download in

App Store

Still not sure? Look at what your fellow peers are saying...

iOS User

I love this app so much [...] I recommend Knowunity to everyone!!! I went from a C to an A with it :D

Stefan S, iOS User

The application is very simple and well designed. So far I have found what I was looking for :D

SuSSan, iOS User

Love this App ❤️, I use it basically all the time whenever I'm studying

Alternative transcript:

names A programmer is trying to decide on a valid name for a variable that represents a house number. Which of the following variable assignments are valid? Why are the others not valid? Reason why not valid 8HouseNumber = 288 houseNumber = 288 house Number = 288 house_number = 288 import = 288 Valid or invalid variable name? invalid Valid invalid Valid invalid Starts with a number Space between the words Import is a built in function What type of error do you get when using an invalid variable name? Invalid syntax Activity 3.2.6 Copy and run this code and explain the result: # Programmer Amy Jones 12/8/2013 # adds two numbers Activity 3.2.7 Data types in Python Complete this table to describe the four data types. Data type Python Explanation abbreviation string numberOne=15 numberTwo=23 answer=numberOne + numberTwo print("The answer is ",answer) integer float boolean int str float bool A whole number Sequence of characters that cannot be changed Numbers with decimal points True False Example (100) ("hello") 18.0 True Hint: Quotation marks are used to show the start and end point of a string, e.g. "this is a string".