-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.txt
92 lines (65 loc) · 2.49 KB
/
test.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
Create a python file called test.py and do the following;
Create the following variables
x, y, z
assign the values 10, 5.4, 2 to the variables respectively.
then print out the solutions to the following problems;
x multiply y (*)
x divide z (/)
x subtract y (-)
y add z (+)
Use python to also print the datatypes of the variables of x, y, z
You are given the list
data = [2,"Angel", 5, 6, 7.9, "Jabari",
"Jayden",2.3, True, "List", False "George", "Risper"]
Create a file named listass.py and perform the following operations on the list
1. Print the length of the list
2. Print all integers in the list
3. Print out all the items in the list
Create a file called whileass.py and solve the following problems
1. Write a program to print first 10 integers
and their squares using while loop.
2. Write for loop statement to print the following series:
10, 20, 30 … … 300
3. Write a while loop statement to print the following series
105, 98, 91 ………7
Create a file called morefunctions.py and provide solutions
for the following problems
1. Write a program to print the sum of the first 10 Even numbers
2. Write a function to print table of a number entered as a parameter in function.
e.g
5 * 1 = 5
5 * 2 = 10
5 * 3 = 15
5 * 4 = 20
5 * 5 = 25
5 * 6 = 30
5 * 7 = 35
5 * 8 = 40
5 * 9 = 45
5 * 10 = 50
3. Write a program to check whether a number is prime or not using while loop.
4. Write a function to print first 10 integers and their squares using while loop.
create a file called sampleapp.py
add the following widgets to the app
1. Button with the name Button1
2. Label that displays the text -> Creating an app on my own
3. Entry widget with the lable my_name
1.Write a Python program to print the following string in a specific format (see the output).
Go to the editor
Sample String : "Twinkle, twinkle, little star, How I wonder what you are! Up above the world so
high, Like a diamond in the sky. Twinkle, twinkle, little star, How I wonder what you are"
Output :
Twinkle, twinkle, little star,
How I wonder what you are!
Up above the world so high,
Like a diamond in the sky.
Twinkle, twinkle, little star,
How I wonder what you are
print("Twinkle, twinkle, little star,")
print(" How I wonder what you are!")
2. Write a Python program to accept a filename from the user
and print the extension of that
my_extension("table.py")
3. Write a function that takes in a list of items an prints out
its length
HINT-> use len() to check for length