To practice the QUIZ-CHAPTER 2 LEARN VARIABLES, click or copy and paste the link in the new browser tab.
https://forms.gle/bTuwYbSuqZ7ZGDsVA
1. bossword = ("Jony, you must go to the shop. Here are the items you need to buy:
"+str(coconut_nos)+" coconuts, "+str(apple_kgs)+" kilogram of apple, "+str(ghee_litres)+" liters of ghee and "+str(coco_oil_litres)+" of coconut oil. You should buy this half liter of coconut oil only if you have money. I will give you "+str(money_rs)+" rupees")
Is this correct code in python?
a)correct, only when +str(variable name)+ term is defined.
b)correct
c)None of above
2. [In]list_items=["coconut","ghee","coconut oil"]
[In]total_items=len(list_items)
[In]total_items
The output is:___________
a)1
b)0
c)2
d)3
3. [In]price_items={"2 coconuts":70,"1 kg apple":200,"1 liter ghee":50,"0.5 liter coconut oil":75}
#jony gets the total price.
[In]total_price=sum(price_items.values())
[In]total_price
The output is________
a)350
b)395
c)400
d)300
4. As soon as a value is assigned to a Python variable, it is created.
a)TRUE
b)FALSE
5. Special characters are not allowed in variable names. A $ (dollar symbol) and _ (underscore) are the sole exceptions.
a)TRUE
b)FALSE
6. Python variables are case-sensitive.
a)true
b)false
7. dic={1:'apple'2:’mango’,3:’jack’}
dic[4]=’banana’
the value of variable 'dic' now becomes
a){1:'apple'2:’mango’,3:’jack’}
b){1:'apple'2:’mango’,3:’jack’,4:'banana'}
c){4:'banana',1:'apple'2:’mango’,3:’jack’}
d)none of above