Logo

Programming - PYTHON 1

Ready to explore more? Discover similar flashcard decks in this domain and related topics.

60 questions
May 27, 2025

Question 1

How do you create a new file in Python IDLE?

Answer

Click on file, then new file.

Question 2

What happens if you type below the three arrows?

Answer

Your document will get lost.

Question 3

What does the print function do?

Answer

It prints something for the user to read.

Question 4

How do you display 'Hello World' using print?

Answer

Use print('Hello World').

Question 5

What does Python's case sensitivity imply?

Answer

You must type things exactly as written.

Question 6

What does 'unexpected indent' mean?

Answer

It indicates there is a space between the margin and your code.

Question 7

How can you fix the indentation error?

Answer

Backspace your code to align it with the left margin.

Question 8

What does EOF unexpected error indicate?

Answer

It indicates a missing bracket.

Question 9

What does EOL while scanning string literal mean?

Answer

There is a missing quotation mark.

Question 10

How do you create a new line in print?

Answer

Use print('this is a new line:\n').

Question 11

How do you create a tab space in print?

Answer

Use print('this is a tab:\t it leaves a space').

Question 12

What is the purpose of the input function?

Answer

It is used to interact with the user for inputting information.

Question 13

What is a variable in Python?

Answer

A space in memory used to store data.

Question 14

How do you create a variable?

Answer

By assigning it a name, like userinput=input('insert something here').

Question 15

What is the function to print user input?

Answer

Use print(userinput).

Question 16

What must be the first character of a variable?

Answer

It must start with a letter.

Question 17

Can variable names have spaces?

Answer

No, spaces will cause an error.

Question 18

What character can be used in place of spaces in variable names?

Answer

You can use underscores (_).

Question 19

What are the main data types in Python?

Answer

String, Integer, Float, and Boolean.

Question 20

How are strings defined?

Answer

Strings are enclosed in quotes.

Question 21

What type of number is 3?

Answer

It is an integer.

Question 22

What is a float?

Answer

A number with a decimal place.

Question 23

What does Boolean represent?

Answer

A true or false value.

Question 24

How can you identify a string versus an integer?

Answer

Strings are in quotes; integers are not.

Question 25

What happens if you try to do math with a string?

Answer

You cannot perform math operations on a string.

Question 26

What does input automatically convert?

Answer

Input converts values into strings.

Question 27

What is casting in Python?

Answer

It's converting one data type to another.

Question 28

How do you convert a string to an integer?

Answer

Use int() function like int(input('33')).

Question 29

What does a hashtag before code indicate?

Answer

It designates a comment which is ignored by Python.

Question 30

What can comments serve as?

Answer

They can act as reminders or hide code.

Question 31

How do you print mixed variables?

Answer

Combine variables and strings using the print function.

Question 32

What is sequential programming?

Answer

It's when code runs in a specific order.

Question 33

What does concatenation do?

Answer

It adds strings together.

Question 34

How do you concatenate strings in Python?

Answer

Use the + operator.

Question 35

What will the output be of print(firstname + surname)?

Answer

It will print JuliaRoebuck without a space.

Question 36

How can you add a space between concatenated strings?

Answer

Concatenate a space like print(firstname + ' ' + surname).

Question 37

Is 'userinput' a valid variable name?

Answer

Yes, it starts with a letter and has no spaces.

Question 38

What is the correct way to use input for age?

Answer

age = int(input('What is your age?')).

Question 39

What will print('You are ', age, 'years old') output?

Answer

It displays the user's age in a sentence.

Question 40

What should you remember about variable names?

Answer

They must be consistent in case sensitivity.

Question 41

How does Python identify reserved keywords?

Answer

They automatically turn purple in the editor.

Question 42

What does a missing closing bracket lead to?

Answer

An EOF unexpected error.

Question 43

What type is '33' in quotes?

Answer

It's a string.

Question 44

What do you receive from int((input('33')))?

Answer

It converts '33' from a string to an integer.

Question 45

What is the result of mixing variable types?

Answer

It can combine numbers and text in print statements.

Question 46

What happens if you miss a quotation mark?

Answer

An EOL while scanning string literal error occurs.

Question 47

Are comments run by Python?

Answer

No, comments are ignored by the interpreter.

Question 48

How do you indicate an indentation error?

Answer

It is usually flagged by Python as 'unexpected indent'.

Question 49

What is the output of 'print("Hello World")'?

Answer

Hello World.

Question 50

Can comments be used for reminders?

Answer

Yes, they can act as reminders in the code.

Question 51

Why do we need to backspace code?

Answer

To correct indentation issues.

Question 52

What is indicated by the term 'input' being purple?

Answer

It signifies that 'input' is a reserved keyword.

Question 53

How do you define a string variable?

Answer

For example, firstname = 'Julia'.

Question 54

Can you perform mathematical operations on strings?

Answer

No, mathematical operations cannot be performed on strings.

Question 55

How should variable names be structured?

Answer

They should not contain spaces and be case consistent.

Question 56

What will result from incorrect indentation?

Answer

You will encounter indentation errors.

Question 57

What does Python automatically do with input?

Answer

It treats all input as strings.

Question 58

What does print(userinput) do?

Answer

It outputs whatever the user entered.

Question 59

Why is it important to close brackets?

Answer

Every open bracket needs a corresponding closing bracket.

Question 60

What is the format for creating a variable with user input?

Answer

userinput = input('insert something here').

Something wrong?Tell us

Advertisement

Support our free flashcard generator by viewing this advertisement.

Advertisement helps keep CardSnap free for everyone

How It Works

Follow these simple steps to create your personalized flashcards.

  1. Upload a file: Upload a file with your notes. It can be Word, PDF or TXT.
  2. Generate PDF: We generate a PDF with formatted flashcards in the language of the uploaded document. This process might take more than 30 seconds, depending on the size of the document.
  3. Print & Study: Print on both sides and cut. Start studying offline, anytime.

    Study Online: View and practice your flashcards interactively in our web app. Bookmark the page so you can come back anytime.

Ready to get started? Create your first flashcard deck now!

Advertisement

Support our free flashcard generator by viewing this advertisement.

Advertisement helps keep CardSnap free for everyone

See it in action

A simple upload. A smart transformation. A printable PDF of flashcards — just like that.

Watch our tutorial to learn how to use CardSnap effectively

Advertisement

Support our free flashcard generator by viewing this advertisement.

Advertisement helps keep CardSnap free for everyone

Why did I build this?

Discover the story behind CardSnap and our mission to make learning accessible.

One day, my daughter asked me to help her study for a science exam. I thought, “Wouldn't it be easier if she had flashcards?”

So I built this tiny tool to convert her notes into printable cards — quickly and simply.

It worked. And now, I'm sharing it in case it helps someone else study better, too.

Join thousands of students and teachers who trust CardSnap for their learning needs

Advertisement

Support our free flashcard generator by viewing this advertisement.

Advertisement helps keep CardSnap free for everyone