Logo

Programming - PYTHON 1

Gata să explorezi mai mult? Descoperă seturi de fișe similare în acest domeniu și subiecte conexe.

60 întrebări
May 27, 2025

Întrebare 1

How do you create a new file in Python IDLE?

Răspuns

Click on file, then new file.

Întrebare 2

What happens if you type below the three arrows?

Răspuns

Your document will get lost.

Întrebare 3

What does the print function do?

Răspuns

It prints something for the user to read.

Întrebare 4

How do you display 'Hello World' using print?

Răspuns

Use print('Hello World').

Întrebare 5

What does Python's case sensitivity imply?

Răspuns

You must type things exactly as written.

Întrebare 6

What does 'unexpected indent' mean?

Răspuns

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

Întrebare 7

How can you fix the indentation error?

Răspuns

Backspace your code to align it with the left margin.

Întrebare 8

What does EOF unexpected error indicate?

Răspuns

It indicates a missing bracket.

Întrebare 9

What does EOL while scanning string literal mean?

Răspuns

There is a missing quotation mark.

Întrebare 10

How do you create a new line in print?

Răspuns

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

Întrebare 11

How do you create a tab space in print?

Răspuns

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

Întrebare 12

What is the purpose of the input function?

Răspuns

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

Întrebare 13

What is a variable in Python?

Răspuns

A space in memory used to store data.

Întrebare 14

How do you create a variable?

Răspuns

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

Întrebare 15

What is the function to print user input?

Răspuns

Use print(userinput).

Întrebare 16

What must be the first character of a variable?

Răspuns

It must start with a letter.

Întrebare 17

Can variable names have spaces?

Răspuns

No, spaces will cause an error.

Întrebare 18

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

Răspuns

You can use underscores (_).

Întrebare 19

What are the main data types in Python?

Răspuns

String, Integer, Float, and Boolean.

Întrebare 20

How are strings defined?

Răspuns

Strings are enclosed in quotes.

Întrebare 21

What type of number is 3?

Răspuns

It is an integer.

Întrebare 22

What is a float?

Răspuns

A number with a decimal place.

Întrebare 23

What does Boolean represent?

Răspuns

A true or false value.

Întrebare 24

How can you identify a string versus an integer?

Răspuns

Strings are in quotes; integers are not.

Întrebare 25

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

Răspuns

You cannot perform math operations on a string.

Întrebare 26

What does input automatically convert?

Răspuns

Input converts values into strings.

Întrebare 27

What is casting in Python?

Răspuns

It's converting one data type to another.

Întrebare 28

How do you convert a string to an integer?

Răspuns

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

Întrebare 29

What does a hashtag before code indicate?

Răspuns

It designates a comment which is ignored by Python.

Întrebare 30

What can comments serve as?

Răspuns

They can act as reminders or hide code.

Întrebare 31

How do you print mixed variables?

Răspuns

Combine variables and strings using the print function.

Întrebare 32

What is sequential programming?

Răspuns

It's when code runs in a specific order.

Întrebare 33

What does concatenation do?

Răspuns

It adds strings together.

Întrebare 34

How do you concatenate strings in Python?

Răspuns

Use the + operator.

Întrebare 35

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

Răspuns

It will print JuliaRoebuck without a space.

Întrebare 36

How can you add a space between concatenated strings?

Răspuns

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

Întrebare 37

Is 'userinput' a valid variable name?

Răspuns

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

Întrebare 38

What is the correct way to use input for age?

Răspuns

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

Întrebare 39

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

Răspuns

It displays the user's age in a sentence.

Întrebare 40

What should you remember about variable names?

Răspuns

They must be consistent in case sensitivity.

Întrebare 41

How does Python identify reserved keywords?

Răspuns

They automatically turn purple in the editor.

Întrebare 42

What does a missing closing bracket lead to?

Răspuns

An EOF unexpected error.

Întrebare 43

What type is '33' in quotes?

Răspuns

It's a string.

Întrebare 44

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

Răspuns

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

Întrebare 45

What is the result of mixing variable types?

Răspuns

It can combine numbers and text in print statements.

Întrebare 46

What happens if you miss a quotation mark?

Răspuns

An EOL while scanning string literal error occurs.

Întrebare 47

Are comments run by Python?

Răspuns

No, comments are ignored by the interpreter.

Întrebare 48

How do you indicate an indentation error?

Răspuns

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

Întrebare 49

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

Răspuns

Hello World.

Întrebare 50

Can comments be used for reminders?

Răspuns

Yes, they can act as reminders in the code.

Întrebare 51

Why do we need to backspace code?

Răspuns

To correct indentation issues.

Întrebare 52

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

Răspuns

It signifies that 'input' is a reserved keyword.

Întrebare 53

How do you define a string variable?

Răspuns

For example, firstname = 'Julia'.

Întrebare 54

Can you perform mathematical operations on strings?

Răspuns

No, mathematical operations cannot be performed on strings.

Întrebare 55

How should variable names be structured?

Răspuns

They should not contain spaces and be case consistent.

Întrebare 56

What will result from incorrect indentation?

Răspuns

You will encounter indentation errors.

Întrebare 57

What does Python automatically do with input?

Răspuns

It treats all input as strings.

Întrebare 58

What does print(userinput) do?

Răspuns

It outputs whatever the user entered.

Întrebare 59

Why is it important to close brackets?

Răspuns

Every open bracket needs a corresponding closing bracket.

Întrebare 60

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

Răspuns

userinput = input('insert something here').

Ceva nu merge bine?Spune-ne

Publicitate

Susține generatorul nostru gratuit de fișe vizualizând această reclamă.

Publicitatea ajută la păstrarea CardSnap gratuit pentru toată lumea

Cum funcționează

Urmărește acești pași simpli pentru a-ți crea fișele personalizate.

  1. Încarcă un fișier: Încarcă un fișier cu notițele tale. Poate fi un document Word, PDF sau TXT.
  2. Generează PDF: Generăm un PDF cu fișe de studiu formatate în limba documentului încărcat. Acest proces poate dura peste 30 de secunde, în funcție de dimensiunea documentului.
  3. Printează și studiază: Printează față-verso și taie. Începe să înveți offline, oricând.

    Studiază online: Vezi și exersează fișele tale interactiv în aplicația noastră web. Salvează pagina ca să te poți întoarce oricând.

Gata să începi? Creează-ți primul set de fișe acum!

Publicitate

Susține generatorul nostru gratuit de fișe vizualizând această reclamă.

Publicitatea ajută la păstrarea CardSnap gratuit pentru toată lumea

Vezi cum funcționează

O încărcare simplă. O transformare inteligentă. Un PDF cu fișe imprimabile — atât de simplu.

Urmărește tutorialul nostru pentru a învăța cum să folosești CardSnap eficient

Publicitate

Susține generatorul nostru gratuit de fișe vizualizând această reclamă.

Publicitatea ajută la păstrarea CardSnap gratuit pentru toată lumea

De ce am creat acest instrument?

Descoperă povestea din spatele CardSnap și misiunea noastră de a face învățarea accesibilă.

Într-o zi, fiica mea m-a rugat să o ajut să învețe pentru un examen la științe. M-am gândit, „N-ar fi mai ușor dacă ar avea fișe de studiu?”

Așa că am creat acest mic instrument pentru a transforma notițele ei în fișe imprimabile — rapid și simplu.

A funcționat. Și acum îl împărtășesc, în speranța că va ajuta și pe altcineva să învețe mai bine.

Alătură-te miilor de studenți și profesori care au încredere în CardSnap pentru nevoile lor de învățare

Publicitate

Susține generatorul nostru gratuit de fișe vizualizând această reclamă.

Publicitatea ajută la păstrarea CardSnap gratuit pentru toată lumea