Questions

4 Marks Quetions

🎯

Test yourself on this topic

5 questions · timed · auto-graded

Question 14 Marks
How will you use the range function and a for loop to print out the numbers 11,12, 13, .... 20?
Answer
self
View full question & answer
Question 34 Marks
Write a program in Python to take an integer as input. If the number is zero or less, print an error message. Otherwise, print out "ab" those many times, end to end. For example:
Input: 0
Error in input 
Input: 3
ababab 
Input: 5
ababababab
Answer
self
View full question & answer
Question 44 Marks
Write a program in Python to take an integer as input. If the number is 0 or less, print an error message. Otherwise, print out your name those number of times on the output screen. For example:
Input: -5
Error in input
Input: 3
DhruvKarthik 
DhruvKarthik
DhruvKarthik
Input: 1
DhruvKarthik
Answer
self
View full question & answer