Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam PCAP All Questions

View all questions & answers for the PCAP exam

Exam PCAP topic 1 question 37 discussion

Actual exam question from Python Institute's PCAP
Question #: 37
Topic #: 1
[All PCAP Questions]

You are going to read just one character from a stream called s. Which statement would you use?

  • A. ch = read (s, 1)
  • B. ch= s.input (1)
  • C. ch= input (s, 1)
  • D. ch= s.read (1)
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️
Reference:
https://stackoverflow.com/questions/510357/python-read-a-single-character-from-the-user

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Arulkumar
1 year, 7 months ago
reader = open("odd_even.txt") ch=reader.read(1) print(ch) Ans : D
upvoted 2 times
...
666_m
2 years, 6 months ago
D. ch= s.read (1)---> correct
upvoted 1 times
...
macxsz
2 years, 7 months ago
Selected Answer: D
answer" D. ch=s.read(1)
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...