暗記メーカー
ログイン
python 1
  • Chi Yu

  • 問題数 100 • 8/6/2024

    記憶度

    完璧

    15

    覚えた

    35

    うろ覚え

    0

    苦手

    0

    未解答

    0

    アカウント登録して、解答結果を保存しよう

    問題一覧

  • 1

    Is it legit in python? How to fix it? int x = 5 y = "John" print(x) print(y)

  • 2

    Is it legit in python? How to fix it? x y = "John" print(x) print(y)

  • 3

    Is it legit in python? What is the data type convertion of x after printed? x = 4 x = "John" print(x)

  • 4

    cast x as a string, y as an integer, and z as a decimal number x = 3 y = 3 z = 3

  • 5

    How to print the data type of x and y? x = 5 y = "John" print(x) print(y)

  • 6

    Are they the same? x = "John" x = 'John'

  • 7

    Is it legit? How to fix it? x,y,z = "orange", "apple" print(x) print(y)

  • 8

    Is it legit? How to fix it? x = y = "orange" print(x) print(y) print(z)

  • 9

    Is it legit to upack this list like this? Any other data structure can be unpacked like this? fruits = ["apple","banana","cherry"] x,y = fruits print(x) print(y)

  • 10

    Is it legit? How to fix it? What is its output? x = "Python" y = "is" z = "awesome" print(x + y, z)

  • 11

    Is it legit? How to fix it? x = 5 y = "John" print(x + y)

  • 12

    Is it legit? How to fix it? x = 5 y = str(6) print(x + y)

  • 13

    Is it legit? How to fix or modify it? x = "awesome" def myfunc(x): print("Python is " + x) myfunc(x)

  • 14

    Is it legit? What is the output? How to fix or modify it? x = "awesome" def myfunc(x): x = "fantastic" print("Python is " + x) myfunc(x) print("Python is " + x)

  • 15

    Is it legit? How to fix or modify it? x = "awesome" def myfunc(x): global x = "fantastic" myfunc(x) print("Python is " + x)

  • 16

    Create a list in python to contain string "apple", string "banana", and string "cherry"

  • 17

    What are the 4 types of built-in data type in python that store a collection of data?

  • 18

    What are the 3 features of list in python?

  • 19

    is it legit? What is the output? How to fix or modify it? thislist = ["apple", "banana", "cherry"] print(thislist)

  • 20

    How can specify the first item in the list?

  • 21

    Does the order of data in a list change after it has been created?

  • 22

    Is it correct that once a list has been created, the data in the list cannot be added, removed, and changed?

  • 23

    Is it legit? What is the output? How can it be fixed or modified? thislist = ["apple", "banana", "apple", "banana", "cherry"] print(thislist)

  • 24

    How can we find the length of the list? thislist = ["apple", "banana", "apple", "banana", "cherry"] print(thislist)

  • 25

    Is it legit? What is the output? How can it be fixed or modified? thislist = ["apple", 30, "apple", True, "cherry"] print(thislist)

  • 26

    What is the output? thislist = ["apple", 30, "apple", True, "cherry"] print(type(thislist))

  • 27

    Create a list with its constructor in python to contain string "apple", string "banana", and string "cherry"

  • 28

    Is python an object oriented programming language?

  • 29

    What model does the python organize its objects?

  • 30

    In python, what is the role of data types and variables respectively?

  • 31

    List the 5 main types of the built-in data type in the python and list their child data type respectively

  • 32

    Do I need to declare variables as one of the data type before using them?

  • 33

    Can variable change their data type after they have been set?

  • 34

    How to assign 10, 2.5, and "Hello" to x,y,z respectively in one line statement?

  • 35

    How to print the 2.5 and "hello" as string and separate them by a space without adding the space character? x,y,z = 10, 2.5, "hello"

  • 36

    Is it legit in python? What is the output? x,y,z = 10, 2.5, "hello" print(x * z)

  • 37

    How to define integer, float, and complex number to x, y, and z respectively?

  • 38

    How to verify the type of object in python?

  • 39

    Is there any limits in length and sign for integer in python?

  • 40

    Is there any limits in length and sign for float in python?

  • 41

    Is it legit in python? What is the output? x = 35e3 print(type(x))

  • 42

    Is it legit in python? What is the output? x = 3 + 5j print(type(x))

  • 43

    How to convert an integer to float , float to integer, integer to complex number in python? - Is it possible to convert complex numbers into another number type?

  • 44

    Which of them are legit? x = int(1) y = int(2.8) z = int("3") k = int("3.3")

  • 45

    Which of them are legit? x = float(1) y = float(2.8) z = float("3") k = float("4.2")

  • 46

    Which of them are legit? x = str("s1") y = str(2) z = str(3.0) k = str(3 + 1j)

  • 47

    What does this code mean? x = 2 y = 5 print(x ** y)

  • 48

    What does this code mean? x = 15 y = 2 print(x // y)

  • 49

    How to expression and, or, not logic in x < 5, x < 10?

  • 50

    What are the results of each print()? What is "is" keyword used for? x = ["apple", "banana"] y = ["apple", "banana"] z = x print(x is z) print(x is y) print(x == y)

  • 51

    What are the results of each print()? What is "is not" keyword used for? x = ["apple", "banana"] y = ["apple", "banana"] z = x print(x is not z) print(x is not y) print(x != y)

  • 52

    What are the results of each print()? What is "in" keyword used for? x = ["apple", "banana"] print("banana" in x) name = "Joe" print(name in ["Joe", "John"])

  • 53

    How to make this code return true by adding appropriate keyword? What does this keyword mean? x = ["apple", "banana"] print("pineapple" ___ x)

  • 54

    How to ask the input from user? - What is the data type of the returning value? - How to convert the user input into int?

  • 55

    What is the output of this code? length = 5 width = 6 area = width*length/9 print(area)

  • 56

    Write a for loop in Python to iteration the list below. When x = banana, dont print the upcoming fruits and banana fruits = ["apple", "banana", "cherry"]

  • 57

    Write a for loop in Python to iteration the list below. When x = banana, skip printing the banana and print the upcoming fruits fruits = ["apple", "banana", "cherry"]

  • 58

    what are 3 ways to use string format() method with placeholder in python? fname = "John" age=36

  • 59

    what should be add to this code in order to format the value of string with percentage? txt = "You scored {add things here}" print(txt.format(0.25))

  • 60

    what should be added to this code in order to format the value of string with no decimal place? txt = "The price is {add things here} dollar" print(txt.format(25.22))

  • 61

    Will the c > d be evaluated when a > b is true? a = 5; b = 7 c = 8; d = 4 if a < b or c > d: print("print this")

  • 62

    What is the output of this code? for x in range(6): print(x)

  • 63

    How can we specify a for loop to print from one number from 2 to 5 on each line in python?

  • 64

    How can we specify a for loop to print from one number from 2 to 30 on each line in python, which the number is incremented by 2 each time?

  • 65

    Is it legit? What is the outcome? How to fix or modify it? What is the purpose of using else? for x in range(6): if x == 3: break print(x) else: print("Finally finished!")

  • 66

    How to leave an empty for loop without error in python?

  • 67

    Write a for loop to iterate a string "banana" and print each letter on each line

  • 68

    Wirte an if else statement for a = 200 and b = 33 with conditions of a > b, a==b, and a<b in python

  • 69

    Write a short-handed if...else statement with 3 conditions of a > b, a = b, and a < b for a = 330, b =330

  • 70

    Can if statement use pass statement to skip its evaluation?

  • 71

    Can while loop use else statement? What is the purpose of using it?

  • 72

    How to iterate each element in the list and print out with its index and value on each line? a = ["Mary", "Has", "a", "little", "lamb"]

  • 73

    What are 3 features of a tuple have?

  • 74

    List out 2 ways that can create a tuple in python - simplest way - way with constructor

  • 75

    How to find the number of elements stored in tuple?

  • 76

    How to create a tuple with only one element?

  • 77

    Is it legit? What is the output? How to fix or modify it? tuple1 = ("abc", 34, True, 40, "male") print(tuple1)

  • 78

    How to print the last item in the tuple with negative index? thistuple = ("apple", "banana", "cherry")

  • 79

    How to print items in the tuple as the following requirements? How will these statements return? thistuple = ("apple", "banana", "cherry", "orange", "kiwi", "melon", "mango") 1. third, fourth, and fifth item 2. print from beginning until reaching to kiwi 3. print from cherry until the end 4. print from orange until melon using negative index

  • 80

    How to determine if "banana" is present in the tuple? Does the keyword find an equal value or equal object? thistuple = ("apple", "banana", "cherry", "orange", "kiwi", "melon", "mango")

  • 81

    How can we modify, add, and delete the value of the tuple even it has been created? Write codes for those 3 actions - What data type can we cast when we nees to modify the items in tuple? x = ("apple", "banana", "cherry")

  • 82

    How can we add a new tuple with only one element inside to an existing tuple? -Do we need to cast for this? x = ("apple", "banana", "cherry")

  • 83

    How can we delete an existing tuple at once? x = ("apple", "banana", "cherry")

  • 84

    What is packing a tuple and unpacking a tuple?

  • 85

    How to unpack the following tuple by those requirements below? Must the number of variables for unpacking the tuple match the number of item in the tuple? fruits = ("apple", "banana", "cherry", "strawberry", "raspberry") 1. unpack each item into one variable 2. unpack apple into variable green, banana into variable yellow, and the rest of them into a list of variable red 3. unpack apple into variable fruit1, raspberry into variable fruit3, and the rest of them into variable fruit2

  • 86

    How to duplicate the items within the tuple? So that fruits = ("apple","banana", "cherry") makes ("apple","banana", "cherry", "apple","banana", "cherry")

  • 87

    How to unpack the list in the tuple into a variable called "list"? How to access to the 3 in the list which is an item of a tuple? mytup = (True, 'orange', [3,4])

  • 88

    What is the result of this code? tup = tuple("hello") print(tup)

  • 89

    How to change the items of the list by the following requirements? thislist = ["apple", "banana", "cherry"] 1. change the banana into "watermelon" 2. change the banana into "watermelon" and add "mango" in the following with one line of code 3. change the banana into "watermelon" and erase the "cherry" with one line of code 4. add a "watermelon" into the list followed by the banana without replacement thislist = ["apple", "banana", "cherry", "orange", "kiwi", "mango"] 5. change the banana and cherry with "watermelon" and "mango" with one line of code

  • 90

    How to create constant in python? Does Python have built-in constant type?

  • 91

    Does Python have ++ and -- operators?

  • 92

    What is the output? thistuple = ("apple", "banana", "cherry", "orange", "kiwi", "melon", "mango") print(thistuple[-1:-4])

  • 93

    What does the zip() function return in python? What is the result if one of the iterable is shorter?

  • 94

    What is iterator? Is iterator an Iterable object?

  • 95

    What parameters does the zip() fucntion take? - What data type? - How many can it take?

  • 96

    How to iterate each value of the tuples after zipping with zip()? - first, create two tuples with the equal length - second, print out the each values stored in each tuple in the zipped object