Question: 1
What kind of data structure is user_data
in the following declaration?
user_data = ("TJ", 24, "artLover123")
原创...大约 3 分钟
What kind of data structure is user_data
in the following declaration?
user_data = ("TJ", 24, "artLover123")
Create a list of your favorite 4 movies. Print out the 0th element in the list. Now set the 0th element to be “Star Wars” and try printing it out again.
创建你最喜欢的4部电影的列表。打印列表中的第0个元素。现在将第0个元素设置为“星球大战”,然后再试着打印它。
# 创建一个包含4部电影的列表
favorite_movies = ["Movie1", "Movie2", "Movie3", "Movie4"]
# 打印列表中的第0个元素
print(favorite_movies[0])
# 将第0个元素设置为“星球大战”
favorite_movies[0] = "星球大战"
# 再次打印列表中的第0个元素
print(favorite_movies[0])
In the following code:「D」
size = 20
x = 100
y = 200
ball = Circle(size)
circle.set_position(x, y)
Write a function that takes one parameter - a float which represents a temperature in Celsius - and returns a float which represents that temperature in Fahrenheit.
Then, write a function that does the opposite conversion.
Here are the formulas for temperature conversion: