A Day Computer Science Manzoor DL 17 due 2:30 PM
IMPORTANT MESSAGE
************************************************
FINAL TERM EXAMINE WILL BE TAKEN IN THREE PARTS BETWEEN (MAY 26 to 28)
PART 1: VOCABULARY TERMS
PART 2: PROGRAMMING CODES
Q1 . A set of instruction given to the computer is called:
Hardware
Software
Computer language
Computer tricks
Q2 . The programming languages that are close to human language are called:
Low level language
Machine language
High level language
Assembly language
Python Programming Question:
Write a program that prints a random number from 1 to 100.
Hint: Using randint () function
https://www.geeksforgeeks.org/python-randint-function/
Hints:
See code below, try changing
r1 = random.randint(0, 10)
to
r1 = random.randint(1, 100)
Code #1 :
filter_none
edit
play_arrow
brightness_4
# Python3 program explaining work
# of randint() function
# imports random module
import random
# Generates a random number between
# a given positive range
r1 = random.randint(0, 10)
print("Random number between 0 and 10 is % s" % (r1))
************************************************
FINAL TERM EXAMINE WILL BE TAKEN IN THREE PARTS BETWEEN (MAY 26 to 28)
PART 1: VOCABULARY TERMS
PART 2: PROGRAMMING CODES
Q1 . A set of instruction given to the computer is called:
Hardware
Software
Computer language
Computer tricks
Q2 . The programming languages that are close to human language are called:
Low level language
Machine language
High level language
Assembly language
Python Programming Question:
Write a program that prints a random number from 1 to 100.
Hint: Using randint () function
https://www.geeksforgeeks.org/python-randint-function/
Hints:
See code below, try changing
r1 = random.randint(0, 10)
to
r1 = random.randint(1, 100)
Code #1 :
filter_none
edit
play_arrow
brightness_4
# Python3 program explaining work
# of randint() function
# imports random module
import random
# Generates a random number between
# a given positive range
r1 = random.randint(0, 10)
print("Random number between 0 and 10 is % s" % (r1))
Code #1 :
Comments
Post a Comment