Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Update 100+ Python challenging programming exercises.txt #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ClaudiuCreanga wants to merge 1 commit into zhiwehu:master
base: master
Choose a base branch
Loading
from ClaudiuCreanga:master
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions 100+ Python challenging programming exercises.txt
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ Level 2

Question:
Write a program which takes 2 digits, X,Y as input and generates a 2-dimensional array. The element value in the i-th row and j-th column of the array should be i*j.
Note: i=0,1.., X-1; j=0,1,��Y-1.
Note: i=0,1.., X-1; j=0,1,¡­Y-1.
Example
Suppose the following inputs are given to the program:
3,5
Expand Down Expand Up @@ -225,7 +225,7 @@ print ','.join(items)
Question 9
Level 2

Question��
Question£o
Write a program that accepts sequence of lines as input and prints the lines after making all characters in the sentence capitalized.
Suppose the following input is supplied to the program:
Hello world
Expand Down Expand Up @@ -425,7 +425,7 @@ Question:
Write a program that computes the net amount of a bank account based a transaction log from console input. The transaction log format is shown as following:
D 100
W 200
��
¡­
D means deposit while W means withdrawal.
Suppose the following input is supplied to the program:
D 300
Expand Down Expand Up @@ -513,8 +513,8 @@ Question:
You are required to write a program to sort the (name, age, height) tuples by ascending order where name is string, age and height are numbers. The tuples are input by console. The sort criteria is:
1: Sort based on name;
2: Then sort based on age;
3: Then sort by score.
The priority is that name > age > score.
3: Then sort by height.
The priority is that name > age > height.
If the following tuples are given as input to the program:
Tom,19,80
John,20,90
Expand Down Expand Up @@ -560,21 +560,21 @@ def putNumbers(n):
if j%7==0:
yield j

for i in reverse(100):
for i in putNumbers(100):
print i
#----------------------------------------#

#----------------------------------------#
Question 21
Level 3

Question��
Question£o
A robot moves in a plane starting from the original point (0,0). The robot can move toward UP, DOWN, LEFT and RIGHT with a given steps. The trace of robot movement is shown as the following:
UP 5
DOWN 3
LEFT 3
RIGHT 2
��
¡­
The numbers after the direction are steps. Please write a program to compute the distance from current position after a sequence of movement and original point. If the distance is a float, then just print the nearest integer.
Example:
If the following tuples are given as input to the program:
Expand Down

AltStyle によって変換されたページ (->オリジナル) /