Computer Science, asked by fathimaroohee, 7 months ago

What will be the output for the following code?
a. print(“my”,”name” ,”is”,”Amit.”)
b. print(“my”,”name” ,”is”,”Amit”,sep=’....’)
c. print(“Hello, Good morning”,end=’ ’)
print(“Are you all enjoying your e-learning class”
d. name=”Simar”
age=17
print(name,”,you are”,17,”now but”,end=””)
print(“you will be”,age+1,”next year”)

Answers

Answered by mojammilhusain45
23

Answer:

a) my name is Amit.

b) my....name....is....Amit

c) Hello, Good morning Are you all enjoying your elearning class

d) Simar, You are 17 now but you will be 18 next year

Explanation:

Answered by ramawtar1919
0

Explanation:

Q1. Is Python case sensitive? What is meant by the term case sensitive?

Q2. Which of the following are valid identifiers and why/why not: Data_rec, _data, 1data, data1, my.file, elif, switch, lambda, break? P a g e 1 9

Q3. What are the two Boolean literals in Python?

Q4. How many ways can a floating literal be represented into?

Q5. Which escape sequence represent the newline character and backspace character? An escape sequence represents how many characters?

Q6. What is a statement in Python? How is a statement different from expression?

Q7. What is a comment? In how many ways can you create comments in Python?

Q8. What is the difference between full line and inline comment?

Q9. What do you mean by dynamic typing of a variable? What is the caution you must take care of?

Q10. What happens when you try to access the value of an undefined variable?

Q11. What is wrong with the following statement? Number = input( Number ) Sqr = Number * Number

Q12. Write code to obtain fee amount and then calculate fee hike as 10% of fees(i.e. fees * 0.10)

Q13. WAP to obtain three numbers and print their sum.

Q14. WAP to obtain length and breadth of a rectangle and calculate its area.

Q15.What will be the sizes of following constants? I. \a II. \a III. Reema\ s IV. \ V. it s VI. XY \ YZ VII. XY YZ

Q16. Write the following real constants in exponent form: 17.251, 151.02, 0.00031, 0.452

Q17. What is None literal in Python?

Q18. Identify the type of following literals: 23.789 23789 True True True False False 0XFACE 0o213

Q19.What is the error in following Python program with one statement? print( My name is, name) Suggest a solution.

Q20. The following code is not giving desired output. We want to input value as 20 and obtain output as 40. Could you pinpoint the problem? Number = input( Enter Nummber ) DoubleTheNumber = Number * 2 Print(DoubleTheNumber)

Q21. What will be the output produced by following code? value = Simar age =17 print(name, you are, 17, now but, end= ) print( you will be, age+1, next year )

Q22. What will be the output of following code? x, y = 7, 2 x, y = y, x + 2 print(x, y)

Q23. Predict the output of the following: x, y = 7, 2 x, y, x = x +1, y +3, x +10 print(x, y) P a g e 2 9

Q24.Find out the error(s) in following code fragments: (i) temperature = 90 print temperature (ii) x = 24 4 = x (iii) a = 30 b = a+b print(a And b) (iv) print( X= X)

Q25. What will be the output produced by following code fragment(s)? (i) X = 10 X = X + 10 X = X 5 print(x) X, Y = X-2, 22 print(x, Y) (ii) first = 2 second = 3 third = first * second print(first, second, third) first = first + second + third third = second * first print(first, second, third) (iii) side = int(input( side )) #side given as 7 area = side * side print(side, area)

Q26. What will be returned by Python as result of following statements? (a) >>>type(0) (b) type(int(0)) (c) type(int( 0 )) (d) type( 0 )

Q27. What will be the output produced by following code? (a) >>> str(print()) + One (b) >>> str(print( hello )) + One

Q28. What will be the output produced by following code? (a) >>> print(print( Hola )) (b) >>> print(print( Hola, end= ))

Q29. Write a program to compute simple interest based on values entered by the user.

Q30. Write Python program that accepts marks in 5 subjects and outputs percentage and average marks.

Q31. Write a short program that asks for your height in centimeters and then converts your height to feet and inches (1 foot = 12 inches, 1 inch = 2.54 cm)

Similar questions