Showing posts with label learn python. Show all posts
Showing posts with label learn python. Show all posts

Monday, November 27, 2023

QUIZ- CHAPTER 2 LEARN VARIABLES

 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


Thursday, November 23, 2023

QUIZ: CHAPTER 1- LEARN DATATYPES IN PYTHON


To practice the QUIZ, click or copy and paste the link in the new browser tab. 

https://forms.gle/ttzbq1GZSUjFewt49 

 1. A group of letters from the source character set that are encased in double       quotation marks is known as a ________________

a)string word

b)string literal

c)string object

d)string datatype

2. Literal refers to _______________and other values passed to variables. 

a)numbers

b)strings

c)characters

d)All the above

3. Variables are the memory locations where literals were saved.

a)TRUE

b)FALSE

4. What is the output for this code: 

     [In]Janu_word=“Today” + “any”

     [In]Janu_word

a)Today+any

b)Todayany

c)Today  any

d)todayany

5. What is the output for this code: 

      [In] waterperplant="1.5"

      [In]waterperplant

      [Out]1.5

      [In]type(waterperplant)

a)string

b)integer

c)float

d)boolean

6. Does Janavi have work today? or not.  The anwer can be identified as datatype of ‘__________’.

a)string

b)integer

c)float

d)boolean

7. Square brackets can access string components.

    import array as arr

    numbersinstory=(1,4,6,"plant")

    print(numbersinstory[0])

    The output for the above shown code:

a)4

b)1

c)6

d)plant

8. Lists are used to hold several elements in a single variable.

a)True

b)False

9. KEY and VALUES are mutually connected at least with one pair. Example: Mom                   assigned 1 task, bought 4 plants and asked to pour 1.5 liters of water per plant. Find the         right form for dictionary datatype.

a)event=['task':1, 'plant':4, 'waterperplant':1.5]

b)event=('task':1, 'plant':4, 'waterperplant':1.5)

c)event={'task':1, 'plant':4, 'waterperplant':1.5}

d)none of all

10.  The data in 'set' datatype is unsorted, unchangeable, and cannot be indexed.

a)True

b)False

CHAPTER 18 EXPLORING THERMODYNAMICS WITH PYTHON: UNDERSTANDING CARNOT'S THEOREM AND MORE

  Python is a versatile programming language that can be used to simulate and analyze various physical phenomena, including thermal physics ...